Documentation
¶
Overview ¶
Node used for displaying a Mesh in 2D. A MeshInstance2D can be automatically created from an existing Sprite2D via a tool in the editor toolbar. Select the Sprite2D node, then choose Sprite2D > Convert to MeshInstance2D at the top of the 2D editor viewport.
Index ¶
- type Advanced
- type Any
- type Extension
- type ID
- type Instance
- func (self Instance) AsCanvasItem() CanvasItem.Instance
- func (self Instance) AsMeshInstance2D() Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsNode2D() Node2D.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) ID() ID
- func (self Instance) Mesh() Mesh.Instance
- func (self Instance) OnTextureChanged(cb func(), flags ...Signal.Flags)
- func (self Instance) SetMesh(value Mesh.Instance)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetTexture(value Texture2D.Instance)
- func (self Instance) Texture() Texture2D.Instance
- func (self Instance) Virtual(name string) reflect.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsCanvasItem ¶
func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance
func (*Extension[T]) AsMeshInstance2D ¶
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.MeshInstance2D
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsCanvasItem ¶
func (self Instance) AsCanvasItem() CanvasItem.Instance
func (Instance) AsMeshInstance2D ¶
func (Instance) Mesh ¶
The Mesh that will be drawn by the MeshInstance2D.
func (Instance) OnTextureChanged ¶
Emitted when the Texture is changed.
func (Instance) SetTexture ¶
SetTexture sets the property returned by [GetTexture].
func (Instance) Texture ¶
The Texture2D that will be used if using the default CanvasItemMaterial. Can be accessed as TEXTURE in CanvasItem shader.