multimesh2d
Thousands of copies of one sprite in one draw, each with its own transform, colour and custom data, through node.multimesh2d.
이 페이지의 내용
Thousands of copies of one sprite in one draw, each with its own transform, colour and custom data, through node.multimesh2d.
17 functions, 0 constants. Scripts reach it as multimesh2d::.
Acts on multimesh2d: those functions are also methods on the component's handle, without the node argument.
Functions
Argument kinds are the script values a call passes: node is a node handle, any a table or value of any kind, fn a callback.
| function | acts on | what it does |
|---|---|---|
buffer(Node) -> [float] |
multimesh2d |
Every instance as one flat list of floats in Godot's MultiMesh.buffer layout: 12 of transform in 3D or 8 in 2D, then 4 of colour and 4 of custom data. |
instance_color(Node, int) -> Color |
multimesh2d |
The colour one instance draws in. |
instance_count(Node) -> int |
multimesh2d |
How many instances the node holds. |
instance_custom_data(Node, int) -> Color |
multimesh2d |
One instance's four floats of custom data, as a colour. |
instance_region(Node, int) -> render::InstanceRegion? |
multimesh2d |
One instance's texture rectangle in pixels, or nil when it draws the whole texture. |
instance_transform(Node, int) -> Transform2d |
multimesh2d |
One instance's transform. |
instances(Node) -> [render::MultimeshInstance] |
multimesh2d |
Every instance as the multimesh asset spells it, so assets.save writes a scripted layout into a file. |
populate(Node, render::PopulateOptions) -> [render::MultimeshInstance] |
multimesh2d |
Godot's Populate Surface, and a row, a ring or a grid: the instances a layout would write, worked out from seed, returned in the multimesh asset's shape rather than set. kind is render.POPULATE_SURFACE with a surface node, POPULATE_ROW (count, step), POPULATE_RING (count, radius) or POPULATE_GRID (counts, step); rotation, tilt and random_scale vary each instance, as fractions, around scale. |
set_buffer(Node, [float]) |
multimesh2d |
Replace every instance from one flat list in the layout buffer answers in, for a Godot port that sets buffer. Building the list in a script costs more than one set_instance_transform per instance. |
set_instance_color(Node, int, Color) |
multimesh2d |
The colour one instance draws in. |
set_instance_count(Node, int) |
multimesh2d |
How many instances the node holds. Those below the count keep where they were; new ones are plain, at the node. |
set_instance_custom_data(Node, int, Color) |
multimesh2d |
Four floats a material's shader reads for one instance, as a colour. |
set_instance_region(Node, int, Vec2, Vec2) |
multimesh2d |
The rectangle of the texture one instance draws, as an origin and a size in texture pixels; a zero size draws all of it. Not drawn yet: multimesh2d draws through Balaur's own pipeline, which binds no rectangle per instance. |
set_instance_transform(Node, int, Transform2d) |
multimesh2d |
Place one instance. A shear is kept, as the instance's basis. |
set_instances(Node, [render::MultimeshInstance]) |
multimesh2d |
Replace every instance with a list in the multimesh asset's shape. |
set_visible_instance_count(Node, int) |
multimesh2d |
How many instances draw, from the first; -1 draws them all. |
visible_instance_count(Node) -> int |
multimesh2d |
How many instances draw; -1 is all of them. |