¶
luxe
API (2025.1.2
)¶
luxe: world
module¶
- Body2D
- Body3D
- BodyEvent
- BodyType
- Clock
- Entity
- EntityContextType
- EntityEventType
- MeshColliderType
- ModifierEventType
- ModifierSystem
- Modifiers
- Overlap
- Physics2D
- Physics3D
- Prototype
- Scene
- UI
- UIBehave
- UIClear
- UIContain
- UIDebugMode
- UIDrop
- UIEvent
- UIImageFit
- UIImageFlags
- UILayoutMode
- UIRenderMode
- WorldEventType
- WorldRenderDesc
Body2D¶
import "luxe: world" for Body2D
no docs found
- create(entity:
Any
) - has(entity:
Any
) - create_collider_box(entity:
Any
, center:Any
, size:Any
, angle:Any
) - create_collider_circle(entity:
Any
, center:Any
, radius:Any
) - get_center(entity:
Any
) - get_mass(entity:
Any
) - get_inertia(entity:
Any
) - set_type(entity:
Any
, type:Any
) - get_type(entity:
Any
) - set_sleeping_allowed(entity:
Any
, allowed:Any
) - get_sleeping_allowed(entity:
Any
) - set_sleeping(entity:
Any
, sleep_state:Any
) - get_sleeping(entity:
Any
) - set_active(entity:
Any
, active_state:Any
) - get_active(entity:
Any
) - set_velocity_linear(entity:
Any
, x:Any
, y:Any
) - get_velocity_linear(entity:
Any
) - set_velocity_angular(entity:
Any
, angle:Any
) - get_velocity_angular(entity:
Any
) - set_damping_linear(entity:
Any
, linear_damping:Any
) - get_damping_linear(entity:
Any
) - set_damping_angular(entity:
Any
, angular_damping:Any
) - get_damping_angular(entity:
Any
) - apply_force(entity:
Any
, force_x:Any
, force_y:Any
, x:Any
, y:Any
, force_awake:Any
) - apply_force(entity:
Any
, force_x:Any
, force_y:Any
, x:Any
, y:Any
) - apply_force(entity:
Any
, force_x:Any
, force_y:Any
, force_awake:Any
) - apply_force(entity:
Any
, force_x:Any
, force_y:Any
) - apply_torque(entity:
Any
, torque:Any
, force_awake:Any
) - apply_torque(entity:
Any
, torque:Any
) - apply_impulse_linear(entity:
Any
, impulse_x:Any
, impulse_y:Any
, x:Any
, y:Any
, force_awake:Any
) - apply_impulse_linear(entity:
Any
, impulse_x:Any
, impulse_y:Any
, x:Any
, y:Any
) - apply_impulse_angular(entity:
Any
, impulse:Any
, force_awake:Any
) - apply_impulse_angular(entity:
Any
, impulse:Any
)
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
, center: Any
, size: Any
, angle: Any
)
¶unknown
no docs found
Any
, center: Any
, radius: Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
, type: Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
, allowed: Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
, sleep_state: Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
, active_state: Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
, x: Any
, y: Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
, angle: Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
, linear_damping: Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
, angular_damping: Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
, force_x: Any
, force_y: Any
, x: Any
, y: Any
, force_awake: Any
)
¶unknown
no docs found
Any
, force_x: Any
, force_y: Any
, x: Any
, y: Any
)
¶unknown
no docs found
Any
, force_x: Any
, force_y: Any
, force_awake: Any
)
¶unknown
no docs found
Any
, force_x: Any
, force_y: Any
)
¶unknown
no docs found
Any
, torque: Any
, force_awake: Any
)
¶unknown
no docs found
Any
, torque: Any
)
¶unknown
no docs found
Any
, impulse_x: Any
, impulse_y: Any
, x: Any
, y: Any
, force_awake: Any
)
¶unknown
no docs found
Any
, impulse_x: Any
, impulse_y: Any
, x: Any
, y: Any
)
¶unknown
no docs found
Any
, impulse: Any
, force_awake: Any
)
¶unknown
no docs found
Any
, impulse: Any
)
¶unknown
no docs found
Body3D¶
import "luxe: world" for Body3D
no docs found
- create(entity:
Any
) - destroy(entity:
Any
) - has(entity:
Any
) - create_heightfield(entity:
Any
, image:Any
) - create_collider_box(entity:
Any
, center:Any
, size:Any
, euler:Any
, physics_asset:Any
) - create_collider_box(entity:
Any
, center:Any
, size:Any
, euler:Any
) - create_collider_sphere(entity:
Any
, center:Any
, radius:Any
, physics_asset:Any
) - create_collider_sphere(entity:
Any
, center:Any
, radius:Any
) - create_collider_cylinder(entity:
Any
, center:Any
, size:Any
, physics_asset:Any
) - create_collider_cylinder(entity:
Any
, center:Any
, size:Any
) - create_collider_capsule(entity:
Any
, center:Any
, radius:Any
, height:Any
, physics_asset:Any
) - create_collider_capsule(entity:
Any
, center:Any
, radius:Any
, height:Any
) - create_collider_mesh(entity:
Any
, center:Any
, euler:Any
, collider_type:MeshColliderType
, mesh_asset:Any
, mesh_level:Any
, physics_asset:Any
) - create_collider_mesh(entity:
Any
, center:Any
, euler:Any
, collider_type:MeshColliderType
, mesh_asset:Any
, mesh_level:Any
) - get_aabb(entity:
Any
) - get_center(entity:
Any
) - get_mass(entity:
Any
) - get_inertia(entity:
Any
) - set_physics_asset(entity:
Any
, physics_asset:Any
) - on(entity:
Any
, type:BodyEvent
, fn:Any
) - off(entity:
Any
, handle:Any
) - set_channel(entity:
Any
, channel:Any
) - set_type(entity:
Any
, type:Any
) - get_type(entity:
Any
) - set_sleeping_allowed(entity:
Any
, allowed:Any
) - get_sleeping_allowed(entity:
Any
) - set_sleeping(entity:
Any
, sleep_state:Any
) - get_sleeping(entity:
Any
) - set_active(entity:
Any
, active_state:Any
) - get_active(entity:
Any
) - set_rotation_allowed(entity:
Any
, axis:Any
) - get_rotation_allowed(entity:
Any
) - set_velocity_linear(entity:
Any
, x:Any
, y:Any
, z:Any
) - get_velocity_linear(entity:
Any
) - set_velocity_angular(entity:
Any
, x:Any
, y:Any
, z:Any
) - get_velocity_angular(entity:
Any
) - set_damping_linear(entity:
Any
, linear_damping:Any
) - get_damping_linear(entity:
Any
) - set_damping_angular(entity:
Any
, angular_damping:Any
) - get_damping_angular(entity:
Any
) - apply_force(entity:
Any
, force_x:Any
, force_y:Any
, force_z:Any
, x:Any
, y:Any
, z:Any
, force_awake:Any
) - apply_force(entity:
Any
, force_x:Any
, force_y:Any
, force_z:Any
, x:Any
, y:Any
, z:Any
) - apply_force(entity:
Any
, force_x:Any
, force_y:Any
, force_z:Any
, force_awake:Any
) - apply_force(entity:
Any
, force_x:Any
, force_y:Any
, force_z:Any
) - apply_torque(entity:
Any
, torque_x:Any
, torque_y:Any
, torque_z:Any
, force_awake:Any
) - apply_torque(entity:
Any
, torque_x:Any
, torque_y:Any
, torque_z:Any
) - apply_impulse_linear(entity:
Any
, impulse_x:Any
, impulse_y:Any
, impulse_z:Any
, x:Any
, y:Any
, z:Any
, force_awake:Any
) - apply_impulse_linear(entity:
Any
, impulse_x:Any
, impulse_y:Any
, impulse_z:Any
, x:Any
, y:Any
, z:Any
) - apply_impulse_angular(entity:
Any
, impulse_x:Any
, impulse_y:Any
, impulse_z:Any
, force_awake:Any
) - apply_impulse_angular(entity:
Any
, impulse_x:Any
, impulse_y:Any
, impulse_z:Any
)
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
, image: Any
)
¶unknown
no docs found
Any
, center: Any
, size: Any
, euler: Any
, physics_asset: Any
)
¶unknown
no docs found
Any
, center: Any
, size: Any
, euler: Any
)
¶unknown
no docs found
Any
, center: Any
, radius: Any
, physics_asset: Any
)
¶unknown
no docs found
Any
, center: Any
, radius: Any
)
¶unknown
no docs found
Any
, center: Any
, size: Any
, physics_asset: Any
)
¶unknown
no docs found
Any
, center: Any
, size: Any
)
¶unknown
no docs found
Any
, center: Any
, radius: Any
, height: Any
, physics_asset: Any
)
¶unknown
no docs found
Any
, center: Any
, radius: Any
, height: Any
)
¶unknown
no docs found
Any
, center: Any
, euler: Any
, collider_type: MeshColliderType
, mesh_asset: Any
, mesh_level: Any
, physics_asset: Any
)
¶unknown
no docs found
Any
, center: Any
, euler: Any
, collider_type: MeshColliderType
, mesh_asset: Any
, mesh_level: Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
, physics_asset: Any
)
¶unknown
no docs found
Any
, type: BodyEvent
, fn: Any
)
¶unknown
no docs found
Any
, handle: Any
)
¶unknown
no docs found
Any
, channel: Any
)
¶unknown
no docs found
Any
, type: Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
, allowed: Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
, sleep_state: Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
, active_state: Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
, axis: Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
, x: Any
, y: Any
, z: Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
, x: Any
, y: Any
, z: Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
, linear_damping: Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
, angular_damping: Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
, force_x: Any
, force_y: Any
, force_z: Any
, x: Any
, y: Any
, z: Any
, force_awake: Any
)
¶unknown
no docs found
Any
, force_x: Any
, force_y: Any
, force_z: Any
, x: Any
, y: Any
, z: Any
)
¶unknown
no docs found
Any
, force_x: Any
, force_y: Any
, force_z: Any
, force_awake: Any
)
¶unknown
no docs found
Any
, force_x: Any
, force_y: Any
, force_z: Any
)
¶unknown
no docs found
Any
, torque_x: Any
, torque_y: Any
, torque_z: Any
, force_awake: Any
)
¶unknown
no docs found
Any
, torque_x: Any
, torque_y: Any
, torque_z: Any
)
¶unknown
no docs found
Any
, impulse_x: Any
, impulse_y: Any
, impulse_z: Any
, x: Any
, y: Any
, z: Any
, force_awake: Any
)
¶unknown
no docs found
Any
, impulse_x: Any
, impulse_y: Any
, impulse_z: Any
, x: Any
, y: Any
, z: Any
)
¶unknown
no docs found
Any
, impulse_x: Any
, impulse_y: Any
, impulse_z: Any
, force_awake: Any
)
¶unknown
no docs found
Any
, impulse_x: Any
, impulse_y: Any
, impulse_z: Any
)
¶unknown
no docs found
BodyEvent¶
import "luxe: world" for BodyEvent
no docs found
- invalid
- overlap
- collide
- name(value:
Any
) - from_string(value:
Any
)
unknown
no docs found
unknown
no docs found
unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
BodyType¶
import "luxe: world" for BodyType
no docs found
- static_body
- dynamic_body
- kinematic_body
- name(value:
Any
) - from_string(value:
Any
)
unknown
no docs found
unknown
no docs found
unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Clock¶
import "luxe: world" for Clock
no docs found
- create(world:
Any
, rate:Any
, paused:Any
) - create(world:
Any
, rate:Any
) - time(world:
Any
, clock:Any
)
Any
, rate: Any
, paused: Any
)
¶unknown
no docs found
Any
, rate: Any
)
¶unknown
no docs found
Any
, clock: Any
)
¶unknown
no docs found
Entity¶
import "luxe: world" for Entity
Anything that exists in a world is a
entity
. The entity itself is just a handle (represented by a number) with which modifiers and a name can be associated. Entities are very lightweight, so creating and destroying many of them usually isnt a concern.An entity in itself does not have a transform (you can attach the
transform
modifier to it to gain that) or any kind of hierarchy (different implicit hierarchies can result from modifiers). Entities can be created manually in code, or loaded as Scenes or Prototypes.
- none
- create(world:
World
) - create(world:
World
, name:String
) - valid(entity:
Entity
) - valid_handle(entity:
Entity
) - get_world(entity:
Entity
) - get(uuid:
String
) - get_addressed_in(context_root:
Entity
, address:List
) - get_addressed(relative_to:
Entity
, address:List
) - resolve(relative_to:
Entity
, address:List
) - get_addressed_context(relative_to:
Entity
, address:List
) - get_named(world:
World
, name:String
) - get_named_all(world:
World
, name:String
) - get_named_in(context:
Entity
, name:String
) - get_named_all_in(context:
Entity
, name:String
) - get_name(entity:
Entity
) - name(entity:
Entity
) - get_folder(entity:
Entity
) - set_folder(entity:
Entity
, folder:String
) - get_asset_id(entity:
Entity
) - set_asset_id(entity:
Entity
, asset_id:String
) - get_context_asset_id(entity:
Entity
) - set_context_asset_id(entity:
Entity
, asset_id:String
) - get_context_type(entity:
Entity
) - get_context_instance_uuid(entity:
Entity
) - get_context(entity:
Entity
) - get_context_origin(entity:
Entity
) - get_context_address(entity:
Entity
, context:Entity
) - list_context_all(context:
Entity
) - list_context_direct(context:
Entity
) - get_context_id(context:
Entity
) - get_origin_address(entity:
Entity
) - get_address(entity:
Entity
) - get_context_is_direct(context:
Entity
, entity:Entity
) - init_into_context(entity:
Entity
, context:Entity
) - init_into_context(entity:
Entity
, context:Entity
, address_uuid:UUID
) - note_add(entity:
Entity
, note:String
) - note_remove(entity:
Entity
, note:String
) - note_has(entity:
Entity
, note:String
) - notes(entity:
Entity
) - set_name(entity:
Entity
, name:String
) - get_uuid(entity:
Entity
) - set_uuid(entity:
Entity
, uuid_string:String
) - destroy(entity:
Entity
) - duplicate(entity:
Entity
) - duplicate(entity:
Entity
, world:World
)
Entity
An entity representing no value. Note, not for comparisons! Use Entity.valid(entity) for that
World
)
¶Entity
Creates a new
entity
in the givenworld
.var player = Entity.create(app.world)
World
, name: String
)
¶Entity
Creates a new
entity
in the givenworld
with the specifiedString
name.var player = Entity.create(app.world, "player")
Entity
)
¶Bool
Checks if the given variable references a valid
entity
.var player = Entity.get_named(app.world, "player") if (Entity.valid(player)) { Log.print("Got the player entity!") }
Entity
)
¶Bool
Checks if the given variable references a valid
entity
handle. Note that when an entity is destroyed, it marks the entity as invalid for Entity.valid(), but the destroy happens at the end of the frame. This means during that frame the entity can still be "live", but not valid.This is mostly useful in the detach handlers, where Entity.valid would return false.
Entity
)
¶World
Get the
world
a givenentity
belongs tovar world = Entity.get_world(entity)
String
)
¶Entity
Get the entity with a given UUID. Since an entity can have a name that is shared by several entities in the same world, the unique ID of an entity is used to locate exactly one entity. Generally, no two entities will have the same UUID.
var entity = Entity.get("5b01869b-fd59-4f2c-892f-4c0b726c79a2") if (Entity.valid(entity)) { Log.print("found entity") }
Entity
, address: List
)
¶Entity
Find an entity by
address
in the given context (only). The address is a list of uuids, and the context is a scene root entity, or prototype root entity.
Entity
, address: List
)
¶Entity
Find an entity by
address
relative to the given entity, and will search upward through all contexts in the tree to try and find the addressed entity. The address is a list of uuids.
Entity
, address: List
)
¶Entity
Find an entity by
address
relative to the given entity, and will search upward through all contexts in the tree to try and find the addressed entity. The address is a list of uuids called aLink
typically. Alias forEntity.get_addressed
.
Entity
, address: List
)
¶Entity
Find an entity by
address
relative to the given entity, and will search upward through all contexts in the tree to try and find the addressed entity - but this function will return the context it was found in (e.g the context the address is for). The address is a list of uuids.
World
, name: String
)
¶Entity
Get the first
entity
from the givenworld
with the namename
. Which entity is returned is unspecified if there are multiple with the same name. If you need to test further useEntity.get_named_all
. Returns null if no entity is found by that name.var player = Entity.get_named(app.world, "player")
World
, name: String
)
¶List
Get a list of all
entities
from the givenworld
with the namename
. Returns a list of entities with an unspecified order. Returns an empty list if no entities are found.var list = Entity.get_named_all(app.world, "fern") Log.print("There are %(list.count) ferns in this forest!")
Entity
, name: String
)
¶Entity
Get the first
entity
from the givencontext
with the namename
. The context is a scene root or a prototype root entity. Which entity is returned is unspecified if there are multiple with the same name. If you need to test further useEntity.get_named_all
. Returns null if no entity is found by that name.var prototype = Prototype.create(world, Asset.prototype("proto/example")) var item = Entity.get_named_in(prototype, "item")
Entity
, name: String
)
¶List
Get a list of all
entities
from the givencontext
with the namename
. The context is a scene root or a prototype root entity. Returns a list of entities with an unspecified order. Returns an empty list if no entities are found.var scene = Scene.load(world, Asset.scene("scene/example")) { var list = Entity.get_named_all_in(scene, "fern") Log.print("There are %(list.count) ferns in this forest!") }
Entity
)
¶StringID
Get the name of a given
entity
as a hashed string ID. Useimport "luxe: assets" for Strings
withStrings.get(name)
to convert to a string. :note: this ID nuance is wip.Entity.set_name(player, "player") var name_id = Entity.get_name(player) var name = Strings.get(name_id) Log.print("Entity name is `%(name)`!") // prints "Entity name is `player`"
Entity
)
¶String
Get the name of a given
entity
as a string. Supports invalid entities (returns<invalid>
).Entity.set_name(player, "player") var name = Entity.name(player) Log.print("Entity name is `%(name)`!") // prints "Entity name is `player`"
Entity
)
¶String
get the folder of this entity (used for nested display in a world outliner)
Entity
, folder: String
)
¶None
set the folder of this entity (used for nested display in a world outliner)
Entity
)
¶String
get the asset ID of this entity (if it has one)
Entity
, asset_id: String
)
¶None
set the asset ID of this entity (used for e.g editor)
Entity
)
¶String
get the context asset ID of this entity (if it has one)
Entity
, asset_id: String
)
¶None
set the context asset ID of this entity (used for e.g editor)
Entity
)
¶EntityContextType
get the context type for an entity
Entity
)
¶String
get the context uuid for a given entity. Entity should be EntityContextType
scene
orprototype
or null is returned
Entity
)
¶Entity
get the context this entity belongs to if any
Entity
)
¶Entity
get the context that this entity originated from. For example if a scene was loaded and inside it there was a prototype and so on, the scene is the origin.
Entity
, context: Entity
)
¶List
get the address of the entity within a given context.
Entity
)
¶Set
Get all the entities this context created as a Set of entities.
Entity
)
¶Set
Get all the entities this context created directly (rather than indirectly) as a Set of entities.
Entity
)
¶String
get the id of the given context.
Entity
)
¶List
get the address of the entity within it's origin context.
Entity
)
¶List
get the address of the entity within it's origin context.
Entity
, entity: Entity
)
¶Bool
returns true if the given entity is a direct entity in the context. This includes prototype roots spawned into the context (use context type to filter them out).
Entity
, context: Entity
)
¶unknown
Initialize an entity into an existing context (typically editor related)
Entity
, context: Entity
, address_uuid: UUID
)
¶unknown
Initialize an entity into an existing context with an address uuid (typically editor related)
Entity
, note: String
)
¶unknown
add a note to this entity (like a lower level tag)
Entity
, note: String
)
¶unknown
remove a note to this entity
Entity
, note: String
)
¶unknown
returns true if this note exists, false otherwise
Entity
)
¶unknown
get all the notes on the given entity
Entity
, name: String
)
¶unknown
Set the name of a given
entity
.Entity.set_name(player, "player")
Entity
)
¶String
Get the unique ID as a string UUID for a given
entity
.
Entity
, uuid_string: String
)
¶unknown
Set the unique ID of a given
entity
. Typically used in special cases, not commonly used on the high level.
Entity
)
¶unknown
Destroy the given
entity
, removing it from the world it's in.At the moment destroy is immediate (potentially changing soon), so sometimes you might want
Frame.end { Entity.destroy(entity) }
to push the destroy to the end of the frame, so it doesn't happen while iterating a list or when things are still processing it.
Entity
)
¶Entity
Duplicate the given
entity
. Returns a new entity with the same notes, folder, name and modifiers.
Entity
, world: World
)
¶Entity
Duplicate the given
entity
into another world. Returns a new entity with the same notes, folder, name and modifiers. Will not duplicate in same context as origin entity if the new world is different.
EntityContextType¶
import "luxe: world" for EntityContextType
no docs found
unknown
no docs found
unknown
no docs found
unknown
no docs found
EntityContextType
)
¶String
no docs found
EntityEventType¶
import "luxe: world" for EntityEventType
no docs found
unknown
no docs found
unknown
no docs found
unknown
no docs found
unknown
no docs found
unknown
no docs found
unknown
no docs found
EntityEventType
)
¶String
no docs found
MeshColliderType¶
import "luxe: world" for MeshColliderType
no docs found
- static_only
- dynamic_convex
- dynamic_concave
- name(value:
Any
) - from_string(value:
Any
)
unknown
no docs found
unknown
no docs found
unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
ModifierEventType¶
import "luxe: world" for ModifierEventType
no docs found
unknown
no docs found
unknown
no docs found
unknown
no docs found
unknown
no docs found
ModifierEventType
)
¶String
no docs found
ModifierSystem¶
import "luxe: world" for ModifierSystem
no docs found
- priority
- persist
- count
- field
- items
- world
- each(fn:
Any
) - each(unique:
Any
, fn:Any
) - find_entity(relative_entity:
Any
, uuid:Any
) - create(entity:
Any
) - destroy(entity:
Any
) - get(entity:
Any
) - get(entity:
Any
, inst:Any
) - get_slot_at(index:
Any
) - get_slot(entity:
Any
) - get_entity(slot:
Any
) - get_id(slot:
Any
) - get_id_hash(slot:
Any
) - set_entity(slot:
Any
, entity:Any
) - editor(editor:
Any
) - init(world:
Any
) - tick(delta:
Any
) - destroy()
- detached()
- attached()
- disable(entity:
Any
, instance:Any
) - attach(entity:
Any
, instance:Any
) - detach(entity:
Any
, instance:Any
) - data
- id
- id=(v : Any)
- on_init(world:
Any
, data:Any
) - on_attached()
- on_detached()
- on_disabled(entities:
Any
, state:Any
) - on_destroying(entities:
Any
) - on_destroyed(entities:
Any
) - on_destroy()
- on_attach_block(block:
Any
, block_start:Any
, block_end:Any
, into:Any
)
unknown
no docs found
unknown
no docs found
unknown
no docs found
unknown
no docs found
unknown
no docs found
unknown
no docs found
Any
)
¶unknown
no docs found
Any
, fn: Any
)
¶unknown
no docs found
Any
, uuid: Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
, inst: Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
, entity: Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
unknown
no docs found
unknown
no docs found
unknown
no docs found
Any
, instance: Any
)
¶unknown
no docs found
Any
, instance: Any
)
¶unknown
no docs found
Any
, instance: Any
)
¶unknown
no docs found
unknown
no docs found
unknown
no docs found
unknown
no docs found
Any
, data: Any
)
¶unknown
no docs found
unknown
no docs found
unknown
no docs found
Any
, state: Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
unknown
no docs found
Any
, block_start: Any
, block_end: Any
, into: Any
)
¶unknown
no docs found
Modifiers¶
import "luxe: world" for Modifiers
no docs found
- get_or_create_block(world:
Any
, module:Any
, block_id:Any
) - attach_uuid(module:
Any
, entity:Any
, uuid:Any
) - detach_uuid(module:
Any
, entity:Any
, uuid:Any
) - has(module:
Any
, entity:Any
) - set_uuid(module:
Any
, entity:Any
, uuid:Any
) - get_uuid(module:
Any
, entity:Any
) - get_attached(entity:
Any
) - get_attached_types(entity:
Any
) - get_entities(module:
Any
) - get_instances(module:
Any
) - get_module(uuid:
Any
) - get_entity(uuid:
Any
) - has_system_in_world(module:
Any
, world:Any
) - get_system_in_world(module:
Any
, world:Any
) - get(module:
Any
, entity:Any
) - get_system(module:
Any
, entity:Any
) - create(module:
Any
, entity:Any
) - destroy(module:
Any
, entity:Any
) - init(world:
Any
, modifier:Any
, block:Any
) - get_asset_compiler(type:
Any
) - get_compiler_for_input(modifier_id:
Any
) - get_data_block_type(modifier_id:
Any
) - get_input_block_type(modifier_id:
Any
)
Any
, module: Any
, block_id: Any
)
¶unknown
no docs found
Any
, entity: Any
, uuid: Any
)
¶unknown
no docs found
Any
, entity: Any
, uuid: Any
)
¶unknown
no docs found
Any
, entity: Any
)
¶unknown
no docs found
Any
, entity: Any
, uuid: Any
)
¶unknown
no docs found
Any
, entity: Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
, world: Any
)
¶unknown
no docs found
Any
, world: Any
)
¶unknown
no docs found
Any
, entity: Any
)
¶unknown
no docs found
Any
, entity: Any
)
¶unknown
no docs found
Any
, entity: Any
)
¶unknown
no docs found
Any
, entity: Any
)
¶unknown
no docs found
Any
, modifier: Any
, block: Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Overlap¶
import "luxe: world" for Overlap
no docs found
unknown
no docs found
unknown
no docs found
unknown
no docs found
unknown
no docs found
Any
)
¶unknown
no docs found
Any
)
¶unknown
no docs found
Physics2D¶
import "luxe: world" for Physics2D
no docs found
- set_gravity(world:
Any
, x:Any
, y:Any
)
Any
, x: Any
, y: Any
)
¶unknown
no docs found
Physics3D¶
import "luxe: world" for Physics3D
no docs found
- set_debug_draw(world:
Any
, state:Any
) - set_gravity(world:
Any
, x:Any
, y:Any
, z:Any
) - cast_ray(world:
Any
, from:Any
, to:Any
) - cast_shape(entity:
Any
, from:Any
, to:Any
, scale:Any
) - cast_shape(entity:
Any
, from:Any
, to:Any
) - query_sphere(world:
Any
, center:Any
, radius:Any
) - query_box(world:
Any
, center:Any
, size:Any
)
Any
, state: Any
)
¶unknown
no docs found
Any
, x: Any
, y: Any
, z: Any
)
¶unknown
no docs found
Any
, from: Any
, to: Any
)
¶unknown
no docs found
Any
, from: Any
, to: Any
, scale: Any
)
¶unknown
no docs found
Any
, from: Any
, to: Any
)
¶unknown
no docs found
Any
, center: Any
, radius: Any
)
¶unknown
no docs found
Any
, center: Any
, size: Any
)
¶unknown
no docs found
Prototype¶
import "luxe: world" for Prototype
Prototypes are collections of entities that are stored together and can be instanced together. Protoype instances can be nested in other prototypes as well as in scenes. If entities in a prototype have a transform modifier without a transform parent, the prototype root will automatically be set as their parent.
Once a prototype is instanced in a world, all its entities behave just like other entities in the world and get assigned unique entity UUIDs. Relative prototype UUIDs, or named entities within a prototype can be accessed via the root entity of the prototype instance.
- destroy(entity:
Entity
) - has(entity:
Entity
) - get_type(entity:
Entity
) - get_root(entity:
Entity
) - get_tree(entity:
Entity
) - has_tree(entity:
Entity
) - get_ref(entity:
Entity
, uuid:String
) - get_ref_of(entity:
Entity
, target_entity:Entity
) - get_named(entity:
Entity
, name:String
) - get_named_all(entity:
Entity
, name:String
) - entity_list(entity:
Entity
) - refs_list(entity:
Entity
) - create(world:
World
, prototype_id:String
, instance_id:String
) - create(world:
World
, prototype_id:String
, instance_id:String
, position:Vec
) - create(world:
World
, prototype_id:String
, instance_id:String
, position:Vec
, rotation:Vec
) - create(world:
World
, prototype_id:String
, instance_id:String
, position:Vec
, rotation:Vec
, scale:Vec
)
Entity
)
¶None
Destroys the prototype instance. (called on the root entity and will also destroy member entities that were instanced with it)
Entity
)
¶Bool
Get whether a entity has a prototype modifier (is a prototype instance root).
Entity
)
¶ID
Get the prototype id the prototype instance was spawned from.
Entity
)
¶Entity
Get the \"innermost\" prototype root if entity is part of a prototype instance. Returns the entity itself if it is a prototype root. Returns null if entity is not part of a prototype instance.
Entity
)
¶List
Get the list of prototype instances this entity is a part of. (List will have 1 elements for unnested prototypes and goes from innermost to outermost instance root for nested prototypes.). Null if entity is not part of prototype instance.
Entity
)
¶Bool
Get whether the entity is part of a prototype instance.
Entity
, uuid: String
)
¶Entity
Get an entity by its reference (prototype-relative UUID) from its prototype root. (the same prototype asset may be instanced multiple times, so it may be important to find a specific prototype root and ask it for its version of the entity)
Entity
, target_entity: Entity
)
¶String
Get the reference (prototype-relative UUID) of an entity within a prototype instance. One Entity can be part of multiple nested prototypes and have different references in each context.
Entity
, name: String
)
¶Entity
Get first entity in a prototype instance with a specific name.
Entity
, name: String
)
¶Entity
Get all entities in a prototype instance with a specific name.
Entity
)
¶List
Get a list of all entities that are part of a prototype instance.
Entity
)
¶List
Get a list of all references (prototype-relative UUIDs) to entities within one prototype instance.
World
, prototype_id: String
, instance_id: String
)
¶unknown
no docs found
World
, prototype_id: String
, instance_id: String
, position: Vec
)
¶unknown
no docs found
World
, prototype_id: String
, instance_id: String
, position: Vec
, rotation: Vec
)
¶unknown
no docs found
World
, prototype_id: String
, instance_id: String
, position: Vec
, rotation: Vec
, scale: Vec
)
¶unknown
Instantiate a new prototype into a world with a new name(instance id), position, rotation and scale. You may pass
null
into position rotation and scale (or call one of the functions that omit those arguments), to give them default values (0,0,0 for position/rotation, 1,1,1 for scale). This function returns the root entity of the newly created prototype instance.
Scene¶
import "luxe: world" for Scene
Scenes are collections of entities that are stored together and can be instanced together. If entities in a scene have a transform modifier without a transform parent, the scene root will automatically be set as their parent.
Once a scene is instanced in a world, all its entities behave just like other entities in the world and get assigned unique entity UUIDs. Relative scene UUIDs, or named entities within a scene can be accessed via the root entity of the scene instance.
Scenes are mostly referred to by their scene ID. By default for new scenes, this is their asset id, but it can be changed to allow loading multiple scenes from the same asset and have them exist in the same world.
- create(world:
World
, id:String
) - destroy(world:
World
, id:String
) - get_list(world:
World
) - exists(world:
World
, id:String
) - entity_list(world:
World
, id:String
) - entity_forget(world:
World
, id:String
, entity:Entity
) - set_id(world:
World
, id:String
, new_id:String
)
World
, id: String
)
¶Entity
Create a new scene into a world. Does not load a scene asset with the given id. This function returns the root entity of the newly created scene.
World
, id: String
)
¶Entity
Destroy a scene by its id.
Scene.create(app.world, "scenes/main") Scene.destroy(app.world, "scenes/main")
World
)
¶List
Get a list of scenes in a world. The list contains the IDs of the scenes (as string IDs).
World
, id: String
)
¶Bool
Check if a scene is currently instanced in a world.
World
, id: String
)
¶List
Get all entities that are part of an instanced scene.
World
, id: String
, entity: Entity
)
¶None
Stop associating an entity with a loaded scene.
World
, id: String
, new_id: String
)
¶unknown
Change the ID of a scene instance.
By default this ID is the asset id, but with this function it can be changed and the original scene loaded again without causting conflicts.
UI¶
import "luxe: world" for UI
A
UI
modifier holds controls which define a 2d user interface with images, buttons, sliders, etc...//create ui modifier in ui world var ui = Entity.create(app.ui) UI.create(ui, 0, 0, world.width, world.height, 0, app.ui_camera) //add controls var control = Control.create(ui) //more control stuff //then rebuild the UI UI.commit(ui)
- create(entity:
Entity
, x:Num
, y:Num
, w:Num
, h:Num
, z:Num
, camera:Entity
) - destroy(entity:
Entity
) - has(entity:
Entity
) - commit(entity:
Entity
) - commit_now(entity:
Entity
) - event_cancel(entity:
Entity
, event_id:ID
) - event_cancelled(entity:
Entity
, event_id:ID
) - set_camera(entity:
Entity
, camera:Entity
) - set_render_mode(entity:
Entity
, mode:UIRenderMode
) - set_material_basis(entity:
Entity
, solid:String
, text:String
) - set_bounds(entity:
Entity
, x:Num
, y:Num
, w:Num
, h:Num
, z:Num
) - get_pos(entity:
Entity
) - get_opacity(entity:
Entity
) - set_opacity(entity:
Entity
, opacity:Num
) - get_size(entity:
Entity
) - get_debug_control(entity:
Entity
) - get_debug_draw_depth(entity:
Entity
) - get_input_node(entity:
Entity
) - set_input_node(entity:
Entity
, input_node_id:String
) - set_layout_mode(entity:
Entity
, mode:UILayoutMode
) - set_debug_mode(entity:
Entity
, mode:UIDebugMode
) - any_marked()
- any_focused()
- get_focused(entity:
Entity
) - get_captured(entity:
Entity
) - get_marked(entity:
Entity
) - get_control_count(entity:
Entity
) - get_control(entity:
Entity
, index:Num
) - focus_invalidate(entity:
Entity
) - focus(control:
Control
) - unfocus(control:
Control
) - mark(control:
Control
) - unmark(control:
Control
) - capture(control:
Control
) - uncapture(control:
Control
) - bring_to_front(control:
Control
) - control_at_point(entity:
Entity
, x:Num
, y:Num
) - mouse_to_canvas(entity:
Entity
, x:Num
, y:Num
) - dump(ui:
Entity
) - spawn(asset_id:
String
, parent:Control
, instance_id:String
) - make(ui:
Entity
, asset:String
, instance_id:String
) - draw_depth_of(control:
Control
, index:Num
) - draw_text(control:
Control
, x:Num
, y:Num
, z:Num
, w:Num
, h:Num
, string:String
, size:Num
, font:String
, color:Color
, align:TextAlign
, align_vertical:TextAlign
) - draw_text(control:
Control
, x:Num
, y:Num
, z:Num
, string:String
, size:Num
, font:String
, color:Color
, align:TextAlign
, align_vertical:TextAlign
) - draw_image(control:
Control
, x:Num
, y:Num
, z:Num
, w:Num
, h:Num
, angle:Num
, color:Color
, uv:Vec
, image:Image
, flags:UIImageFlags
) - draw_image(control:
Control
, x:Num
, y:Num
, z:Num
, w:Num
, h:Num
, angle:Num
, color:Color
, uv:Vec
, image:Image
) - draw_quad(control:
Control
, x:Num
, y:Num
, z:Num
, w:Num
, h:Num
, angle:Num
, color:Color
) - draw_circle(control:
Control
, ox:Num
, oy:Num
, oz:Num
, rx:Num
, ry:Num
, start_angle:Num
, end_angle:Num
, smoothness:Num
, color:Color
) - draw_line(control:
Control
, x1:Num
, y1:Num
, x2:Num
, y2:Num
, z:Num
, style:PathStyle
) - draw_rect(control:
Control
, x:Num
, y:Num
, z:Num
, w:Num
, h:Num
, angle:Num
, style:PathStyle
) - draw_rect_detailed(control:
Control
, x:Num
, y:Num
, z:Num
, w:Num
, h:Num
, angle:Num
, radius:Num
, smoothness:Num
, style:PathStyle
) - draw_quad_detailed(control:
Control
, x:Num
, y:Num
, z:Num
, w:Num
, h:Num
, angle:Num
, radius:Num
, smoothness:Num
, color:Color
) - draw_ring(control:
Control
, ox:Num
, oy:Num
, oz:Num
, rx:Num
, ry:Num
, start_angle:Num
, end_angle:Num
, smoothness:Num
, style:PathStyle
) - draw_path(control:
Control
, points:List
, style:PathStyle
, closed:Bool
) - events_emit(control:
Control
, type:UIEvent
) - events_emit(control:
Control
, type:UIEvent
, data:Any
) - events_emit(control:
Control
, type:UIEvent
, data:Any
, data_before:Any
)
Entity
, x: Num
, y: Num
, w: Num
, h: Num
, z: Num
, camera: Entity
)
¶None
Create a UI modifier on an Entity. The
x
y
z
arguments are the position relative to the world origin, or relative to theTransform
on the same entity if one exists.w
andh
are the width and the height of the canvas, this is both used for the mask texture (and inUIRenderMode.image
the ui rendertarget) as well as the (unscaled) size of the UI in worldspace.camera
describes a camera that is used to resolve input, most of the time this is the camera rendering the world the UI is in, but it doesnt have to be.
Entity
)
¶None
Remove a
UI
modifier from an entity. This also destroys all controls on thatUI
.
Entity
)
¶Bool
Get whether an Entity has an
UI
modifier attached.
Entity
)
¶None
Request all changes to the UI are committed before rendering happens
Entity
)
¶None
Commit all changes to the UI immediately
Entity
, event_id: ID
)
¶None
Cancel an event.
Entity
, event_id: ID
)
¶Bool
Check whether an event was cancelled before.
Entity
, camera: Entity
)
¶None
Set the camera used for input calculations. Most of the time this is the camera rendering the world the UI is in, but it doesnt have to be.
Entity
, mode: UIRenderMode
)
¶None
Set the render mode of the UI canvas.
UIRenderMode.world
renders the controls directly into the world, whileUIRenderMode.image
first renders them to an intermediate texture and then renders that.
UIRenderMode.image
is the default as it can avoid artifacts and works in more circumstances, thoughUIRenderMode.world
can lead to more sharp results and slightly better performance.
Entity
, solid: String
, text: String
)
¶None
Set the material basis the controls (excluding
UIImage
) is drawn with. By default "luxe: material_basis/ui_solid" is the basis for solid controls and "luxe: material_basis/ui_font" the basis for text.
Entity
, x: Num
, y: Num
, w: Num
, h: Num
, z: Num
)
¶None
Set size and position of an
UI
modifier. Thex
y
z
arguments are the position relative to the world origin, or relative to theTransform
on the same entity if one exists.w
andh
are the width and the height of the canvas, this is both used for the mask texture (and inUIRenderMode.image
the ui rendertarget) as well as the (unscaled) size of the UI in worldspace.
Entity
)
¶Vec
Get position of an
UI
modifier.
Entity
)
¶Num
Get overall UI opacity
Entity
, opacity: Num
)
¶Num
Set overall UI opacity
Entity
)
¶Vec
Get size of an
UI
modifier.
Entity
)
¶Control
no docs found
Entity
)
¶Num
no docs found
Entity
)
¶String
no docs found
Entity
, input_node_id: String
)
¶None
no docs found
Entity
, mode: UILayoutMode
)
¶None
Set the layout mode of the UI.
By default this is
UILayoutMode.none
, which will do no extra layouting and ignoreControl
margin, behave and contain.
UILayoutMode.flex
is the default layout implementation which will follow theControl
margin, behave and contain settings.UI.set_layout_mode(ui, UILayoutMode.flex) var root = Control.create(ui) Control.set_size(root, 300, 0) Control.set_behave(root, UIBehave.left | UIBehave.top) Control.set_margin(root, 100, 100, 0, 0) Control.set_contain(root, UIContain.column | UIContain.start | UIContain.vfit) var text_input = UIText.create(ui) Control.set_behave(text_input, UIBehave.left | UIBehave.top | UIBehave.hfill) Control.child_add(root, text_input) var image = UIImage.create(ui) UIImage.set_image(image, Assets.image("luxe: image/logo.sprite")) Control.set_size(image, 300, 300) Control.set_behave(image, UIBehave.left | UIBehave.top | UIBehave.hfill) Control.child_add(root, image)
Entity
, mode: UIDebugMode
)
¶None
no docs found
Bool
Returns true if any UI has a marked control (any control with input under the mouse)
Bool
Returns true if any UI has a focused control
Entity
)
¶Control
Get currently focussed control. A control being focused means its been clicked on or otherwise focused and will recieve context inputs like keyboard presses on a text input field.
Entity
)
¶Control
Get captured control,
null
if none is captured. A control being captured means all inputs will only be sent to this control until it is uncaptured again.
Entity
)
¶Control
Get marked control,
null
if none is marked. A control being marked means it is hovered over and can be focused.
Entity
)
¶Num
Get amount of controls in a
UI
.
Entity
, index: Num
)
¶Control
Get a control in a
UI
by its index. Useful for iterating over all controls.
Entity
)
¶None
Unfocus whatever is focussed in a specific
UI
.
Control
)
¶None
Focus a control. Will unfocus any previously focused controls on the
UI
. A control being focused means its been clicked on or otherwise focused and will recieve context inputs like keyboard presses on a text input field.
Control
)
¶None
Unfocus a specific control. If the control is not the focused control in the UI, this does nothing.
Control
)
¶None
Mark a control. Will unfocus any previously marked controls on the
UI
. A control being marked means it is hovered over and can be focused.
Control
)
¶None
Unmark a specific control. If the control is not the marked control in the UI, this does nothing.
Control
)
¶None
Capture a control. Until uncaptured all inputs will only go to this control.
Control
)
¶None
Uncapture a control and have inputs be distributed regularly.
Control
)
¶None
Bring the control to the front in its current context (globally in the
UI
or within its parent if its a child)
Entity
, x: Num
, y: Num
)
¶Control
Get the highest control at a position.
Entity
, x: Num
, y: Num
)
¶Float2
Translate from mouse position on screen to canvas coordinates. Uses the set canvas camera.
Entity
)
¶None
Write a bunch of information about the
UI
and its controls into the console.
String
, parent: Control
, instance_id: String
)
¶None
Spawn controls from a ui asset. Puts newly spawned controls into a parent control.
Entity
, asset: String
, instance_id: String
)
¶Control
Spawn controls from a ui asset. Creates new root for newly spawned controls and returns that root control.
Control
, index: Num
)
¶None
no docs found
Control
, x: Num
, y: Num
, z: Num
, w: Num
, h: Num
, string: String
, size: Num
, font: String
, color: Color
, align: TextAlign
, align_vertical: TextAlign
)
¶None
no docs found
Control
, x: Num
, y: Num
, z: Num
, string: String
, size: Num
, font: String
, color: Color
, align: TextAlign
, align_vertical: TextAlign
)
¶None
no docs found
Control
, x: Num
, y: Num
, z: Num
, w: Num
, h: Num
, angle: Num
, color: Color
, uv: Vec
, image: Image
, flags: UIImageFlags
)
¶None
no docs found
Control
, x: Num
, y: Num
, z: Num
, w: Num
, h: Num
, angle: Num
, color: Color
, uv: Vec
, image: Image
)
¶None
no docs found
Control
, x: Num
, y: Num
, z: Num
, w: Num
, h: Num
, angle: Num
, color: Color
)
¶None
no docs found
Control
, ox: Num
, oy: Num
, oz: Num
, rx: Num
, ry: Num
, start_angle: Num
, end_angle: Num
, smoothness: Num
, color: Color
)
¶None
no docs found
Control
, x1: Num
, y1: Num
, x2: Num
, y2: Num
, z: Num
, style: PathStyle
)
¶None
no docs found
Control
, x: Num
, y: Num
, z: Num
, w: Num
, h: Num
, angle: Num
, style: PathStyle
)
¶None
no docs found
Control
, x: Num
, y: Num
, z: Num
, w: Num
, h: Num
, angle: Num
, radius: Num
, smoothness: Num
, style: PathStyle
)
¶None
no docs found
Control
, x: Num
, y: Num
, z: Num
, w: Num
, h: Num
, angle: Num
, radius: Num
, smoothness: Num
, color: Color
)
¶None
no docs found
Control
, ox: Num
, oy: Num
, oz: Num
, rx: Num
, ry: Num
, start_angle: Num
, end_angle: Num
, smoothness: Num
, style: PathStyle
)
¶None
no docs found
Control
, points: List
, style: PathStyle
, closed: Bool
)
¶None
no docs found
Control
, type: UIEvent
)
¶None
no docs found
Control
, type: UIEvent
, data: Any
)
¶None
no docs found
Control
, type: UIEvent
, data: Any
, data_before: Any
)
¶None
no docs found
UIBehave¶
import "luxe: world" for UIBehave
no docs found
unknown
Item anchors to the item to its left or left side of parent
unknown
Item anchors to the item above it or top side of parent
unknown
Item anchors to the item to its right or right side of parent
unknown
Item anchors to the item below it or bottom side of parent
unknown
Item anchors to both left and right item or parent borders
unknown
Item anchors to both top and bottom item or parent borders
unknown
Center item horizontally, with left margin as offset
unknown
Center item vertically, with top margin as offset
unknown
Center item in both directions, with left/top margin as offset
unknown
Anchor item to all four directions
unknown
no docs found
UIClear¶
import "luxe: world" for UIClear
no docs found
unknown
no docs found
unknown
no docs found
unknown
no docs found
unknown
no docs found
UIContain¶
import "luxe: world" for UIContain
no docs found
unknown
Items go from left to right
unknown
Items go from top to bottom
unknown
Use Free Layout model
unknown
Use Flex Layout model
unknown
Stays on a single line
unknown
Wraps to multiple lines, wrapping left to right
unknown
Items begin at start of row/column
unknown
Items begin at middle of row/column
unknown
Items begin at end of row/column
unknown
Insert spacing between items to stretch elements across whole row/column
unknown
Items stretch height to fill vertical space
unknown
Items stretch width to fill horizontal space
UIDebugMode¶
import "luxe: world" for UIDebugMode
no docs found
unknown
no docs found
unknown
no docs found
UIDrop¶
import "luxe: world" for UIDrop
no docs found
unknown
no docs found
unknown
no docs found
unknown
no docs found
unknown
no docs found
UIEvent¶
import "luxe: world" for UIEvent
The built in UI events that all controls can potentially use.
- name(value:
Any
) - unknown
- enter
- exit
- press
- release
- scroll
- move
- key
- text
- focus
- unfocus
- capture
- uncapture
- commit
- destroy
- language
- change
- bounds
- drag
Any
)
¶unknown
Converts a UIEvent value to a readable name.
Log.print(UIEvent.name(UIEvent.move)) //prints "move"
unknown
An event of unknown type, invalid. This is the default value.
unknown
An input cursor has entered this control. (e.g on mouse enter). Sends no additional data in the event.
if(event.type == UIEvent.enter) { Log.print("entered control!") }
unknown
An input cursor has left this control. (e.g on mouse exit) Sends no additional data in the event.
if(event.type == UIEvent.exit) { Log.print("exited control!") }
unknown
An input press event (e.g mouse button was pressed down). a.k.a "down" Sends
event.x
,event.y
andevent.button
.if(event.type == UIEvent.press) { var button = MouseButton.name(event.button) Log.print("pressed down on control at `%(event.x)`,`%(event.y)`") Log.print(" button was `%(button)`") }
unknown
An input release event (e.g mouse button was released). a.k.a "up" Sends
event.x
,event.y
andevent.button
.if(event.type == UIEvent.press) { var button = MouseButton.name(event.button) Log.print("released input on control at `%(event.x)`,`%(event.y)`") Log.print(" button was `%(button)`") }
unknown
A scroll event (e.g mouse wheel). Sends
event.x
,event.y
wherex
is the horizontal scroll amount, andy
is the vertical scroll amount.if(event.type == UIEvent.scroll) { Log.print("scroll amount `%(event.x)`,`%(event.y)`") }
unknown
An input move event (e.g mouse movement). Sends
event.x
,event.y
as the position of the input.if(event.type == UIEvent.press) { Log.print("move on control at `%(event.x)`,`%(event.y)`") }
unknown
A key input event. Sends a few useful values:
event.key
- a Key valueevent.scan
- a Scan valueevent.mod
- a ModState valueevent.down
- aBool
value, whether the key is down or notevent.repeat
- aBool
value, whether the event is from a key repeatif(event.type == UIEvent.key) { var down = event.down ? "pressed" : "released" Log.print("key %(down), key was `%(Key.name(event.key))`") Log.print(" scan `%(Scan.name(event.scan))`, repeat? %(event.repeat)") if(event.mod.lshift || event.mod.rshift) { Log.print("shift was also held down!") } }
unknown
A control has sent a text event, which originates from typing.
These events allow handling complex input that comes from the OS level IME input dialogs. On the simplest level, displaying
event.text
is enough to get started.Sends the following:
event.text
- the latest text displayedevent.text_start
- the start of the modified textevent.text_length
- the length of the modified textevent.text_type
- a TextEvent type (edit
orinput
)The easiest way to understand might be to see. This video shows this at work.
As a user is typing, there may be candidates avaiable to select from, when this is true, these are sent as
TextInput.edit
events, with a start and end. When a candidate is selected (or no choices), aTextEvent.input
is sent with thetext
.
unknown
A control has gained focus. Sends no additional data in the event.
if(event.type == UIEvent.focus) { Log.print("gained focus!") }
unknown
A control has lost focus. Sends no additional data in the event.
if(event.type == UIEvent.unfocus) { Log.print("lost focus!") }
unknown
A control has been captured.
if(event.type == UIEvent.capture) { Log.print("gained input capture!") }
unknown
A control has lost capture status.
if(event.type == UIEvent.uncapture) { Log.print("lost input capture!") }
unknown
When a control has changeable state (like an editable text control), it will send a
commit
event when the contents are being applied/committed. For example, if you are typing text and hit enter, or unfocus the control.if(event.type == UIEvent.uncapture) { Log.print("lost input capture!") }
unknown
When a control is destroyed you'll get notified here. Keep in mind that it's destroyed.
if(event.type == UIEvent.destroy) { Log.print("destroyed!") }
unknown
When the UI lanuage changes, your control will receive this event.
if(event.type == UIEvent.language) { Log.print("language changed.. I should update my size..") }
unknown
Change events are context specific, but notify you of a change in state. For example, UIWindow sends a change event with UIWindowChange to notify when a window was closed, collapsed or uncollapsed. A UIText sends a change event when the text has been changed, via typing or otherwise.
In each case,
event.change
contains the relevant data.//UIText example if(event.type == UIEvent.change) { Log.print("text changed `%(event.change)`!") }
unknown
A control has changed bounds (note: this may not be working as intended right now). Sends
event.dx
,event.dy
andevent.dw
,event.dh
whered
meansdelta
. i.e the change in bounds as a difference between now and before.if(event.type == UIEvent.bounds) { if(event.dx != 0) Log.print("moved on x by %(event.dx) amount!") if(event.dy != 0) Log.print("moved on y by %(event.dy) amount!") if(event.dw != 0) Log.print("width changed by %(event.dw) amount!") if(event.dh != 0) Log.print("height changed by %(event.dh) amount!") }
unknown
When a control is dragged or dropped on the UI canvas. The data field contains the kind of event, e.g UIDrag.start or UIDrag.end. The x/y is the start, and end_x/end_y is the end (for a start they're the same)
if(event.type == UIEvent.drag) { Log.print("control drag changed.. %(event.data)") }
UIImageFit¶
import "luxe: world" for UIImageFit
no docs found
unknown
no docs found
unknown
no docs found
unknown
no docs found
unknown
no docs found
unknown
no docs found
UIImageFlags¶
import "luxe: world" for UIImageFlags
no docs found
unknown
uses linear interpolation samplers, interpolating smoothly between pixels.
unknown
uses nearest neighbor samplers, leading to an interpolated look.
unknown
uses trilinear interpolation samplers, interpolating smoothly between pixels and mip levels.
UILayoutMode¶
import "luxe: world" for UILayoutMode
no docs found
unknown
no docs found
unknown
no docs found
UIRenderMode¶
import "luxe: world" for UIRenderMode
no docs found
unknown
no docs found
unknown
no docs found
unknown
no docs found
WorldEventType¶
import "luxe: world" for WorldEventType
no docs found
unknown
no docs found
unknown
no docs found
unknown
no docs found
unknown
no docs found
unknown
no docs found
WorldEventType
)
¶String
no docs found
WorldRenderDesc¶
import "luxe: world" for WorldRenderDesc
no docs found
- camera
- camera=(v : Any)
- camera(v:
Any
) - cull_camera
- cull_camera=(v : Any)
- cull_camera(v:
Any
) - new()
unknown
no docs found
unknown
no docs found
Any
)
¶unknown
no docs found
unknown
no docs found
unknown
no docs found
Any
)
¶unknown
no docs found
WorldRenderDesc
no docs found