Documentation
¶
Index ¶
- Constants
- func LuaTableToGo(l *lua.State, index int) any
- func LuaToGo(l *lua.State, index int) any
- func PushAny(l *lua.State, v any)
- func PushScaledPoint(l *lua.State, sp bag.ScaledPoint)
- func RegisterScaledPointMetaTable(l *lua.State)
- func SpFromString(l *lua.State) int
- func SpMax(l *lua.State) int
- func SpMin(l *lua.State) int
- func SpNew(l *lua.State) int
- func ToScaledPointValue(l *lua.State, index int) (bag.ScaledPoint, bool)
- type ScaledPoint
Constants ¶
const ScaledPointMetaTable = "ScaledPoint"
Variables ¶
This section is empty.
Functions ¶
func LuaTableToGo ¶
LuaTableToGo converts a Lua table to a Go slice (for array-like tables with consecutive integer keys 1..n) or map[string]any (otherwise).
func LuaToGo ¶
LuaToGo reads the Lua value at index and returns the Go equivalent. Tables become map[string]any or []any, numbers become int or float64, strings and booleans map directly.
func PushAny ¶
PushAny pushes a Go value onto the Lua stack as the corresponding Lua type. Supported types: nil, bool, float64, int, string, map[string]any, []any.
func PushScaledPoint ¶
func PushScaledPoint(l *lua.State, sp bag.ScaledPoint)
PushScaledPoint creates a new ScaledPoint userdata and pushes it onto the stack
func RegisterScaledPointMetaTable ¶
RegisterScaledPointMetaTable creates the ScaledPoint metatable
func SpFromString ¶
SpFromString creates a ScaledPoint userdata from string: sp_string("12pt")
func ToScaledPointValue ¶
ToScaledPointValue converts a Lua value (ScaledPoint, string, or number) to bag.ScaledPoint Returns the value and true on success, or 0 and false on failure
Types ¶
type ScaledPoint ¶
type ScaledPoint struct {
Value bag.ScaledPoint
}
ScaledPoint wraps bag.ScaledPoint as Lua userdata
func CheckScaledPoint ¶
func CheckScaledPoint(l *lua.State, index int) *ScaledPoint
CheckScaledPoint retrieves a ScaledPoint userdata from the stack
func TestScaledPoint ¶
func TestScaledPoint(l *lua.State, index int) *ScaledPoint
TestScaledPoint checks if the value at index is a ScaledPoint userdata