GArray

gdext.builtin.GArray$package.GArray
object GArray

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
GArray.type

Members list

Value members

Concrete methods

def allocate(): GArray

An empty Array in heap storage; release with free.

An empty Array in heap storage; release with free.

Attributes

Construct an empty Array into caller storage.

Construct an empty Array into caller storage.

Attributes

def emptyTyped(dest: GDExtensionTypePtr, elemType: GDExtensionVariantType, className: String): GArray

Construct an empty typed Array into caller storage, via Array's typed constructor (index 2: Array(base, type, class_name, script)). Typing the array makes Godot fill new elements with the element type's default (e.g. "" for String) instead of <null> when the inspector adds a row.

Construct an empty typed Array into caller storage, via Array's typed constructor (index 2: Array(base, type, class_name, script)). Typing the array makes Godot fill new elements with the element type's default (e.g. "" for String) instead of <null> when the inspector adds a row.

elemType is the element's variant type; className is the element class name for OBJECT elements (e.g. "Enemy"), "" for builtins.

Attributes

Reinterpret a raw handle as a GArray (the opaque type is its pointer).

Reinterpret a raw handle as a GArray (the opaque type is its pointer).

Attributes

inline def scope[R](body: GArray => R): R

Run body with a stack-allocated empty Array; destroyed on exit.

Run body with a stack-allocated empty Array; destroyed on exit.

Attributes

Extensions

Extensions

extension (a: GArray)
def destroy(): Unit
def free(): Unit

destroy plus releasing the malloc'd handle from allocate.

destroy plus releasing the malloc'd handle from allocate.

Attributes

def get[A](i: Int)(using fv: FromVariant[A]): A

Read element i as a Scala value.

Read element i as a Scala value.

Attributes

def isNilAt(i: Int): Boolean
def pushBack[A](value: A)(using tv: ToVariant[A]): Unit

Append a value (calls Array.push_back).

Append a value (calls Array.push_back).

Attributes

def set[A](i: Int, value: A)(using tv: ToVariant[A]): Unit
def size: Int

Number of elements (calls Array.size).

Number of elements (calls Array.size).

Attributes