This is used when both go and lua need to reference the same mutable data.
Functions
new
new(value, type?) -> int<ref.REFType.*>
References are used when go and lua need to share a reference to the same value. The primitive type versions must be used when that value must be a Go value. Also note that when refs are used for indexes in Go that they must start at 0 not 1.
- value
any
- type
int<ref.REFType>
- Must be compatible with the above value.
int<ref.REFType.*>
new_slice
new_slice(ln, type?) -> int<ref.REFType.*>
References are used when go and lua need to share a reference to the same value. The primitive type versions must be used when that value must be a Go value. Also note that when refs are used for indexes in Go that they must start at 0 not 1. This also includes the slice created here, it's index starts at 0.
- ln
int
- A fixed length for the slice. - type
int<ref.REFType>
- Must be compatible with the values set into the slice.
int<ref.REFType.*>
get
get(id) -> any
Note: this is a copy of the value being referenced, to mutate the ref use 'ref.set()'.
- id
int<ref.REFType.*>
any
- Will be a set type deteremined by the REFType.
get_slice
get_slice(id, index) -> any
Note: this is a copy of the value being referenced, to mutate the ref use 'ref.set_slice()'.
- id
int<ref.REFType.*>
- index
int
- Must be within the range of 0 to 1 less than the set length.
any
- Will be a set type determined by the REFType.
len_slice
len_slice(id) -> int
- id
int<ref.REFType.*>
int
- The length of the slice in the ref.
set
set(id, value)
- id
int<ref.REFType.*>
- value
any
- Must be compatible with the set REFType.
set_slice
set_slice(id, index, value)
- id
int<ref.REFType.*>
- index
int
- Must be in range 0 to 1 less than the set length. - value
any
- Must be compatible with the set REFType.
del
del(id)
- id
int<ref.REFType.*>
del_many
del_many(ids...)
- ids
int<ref.REFType.*>...
Constants
REFType
LUA
BOOL
INT
INT32
FLOAT
FLOAT32
STRING
RGBA - Use in lua as struct<image.Color>.
TIME - Use in lua as a number representing the time in ms.
FONT - Internal 'giu.FontInfo', cannot be created or set, getting will return the result of 'font.String()'.