Skip to content

luxe API (2025.1.2)


luxe: world module


Body2D

import "luxe: world" for Body2D

no docs found


Body2D.create(entity: Any) returns unknown

no docs found

Body2D.has(entity: Any) returns unknown

no docs found

Body2D.create_collider_box(entity: Any, center: Any, size: Any, angle: Any) returns unknown

no docs found

Body2D.create_collider_circle(entity: Any, center: Any, radius: Any) returns unknown

no docs found

Body2D.get_center(entity: Any) returns unknown

no docs found

Body2D.get_mass(entity: Any) returns unknown

no docs found

Body2D.get_inertia(entity: Any) returns unknown

no docs found

Body2D.set_type(entity: Any, type: Any) returns unknown

no docs found

Body2D.get_type(entity: Any) returns unknown

no docs found

Body2D.set_sleeping_allowed(entity: Any, allowed: Any) returns unknown

no docs found

Body2D.get_sleeping_allowed(entity: Any) returns unknown

no docs found

Body2D.set_sleeping(entity: Any, sleep_state: Any) returns unknown

no docs found

Body2D.get_sleeping(entity: Any) returns unknown

no docs found

Body2D.set_active(entity: Any, active_state: Any) returns unknown

no docs found

Body2D.get_active(entity: Any) returns unknown

no docs found

Body2D.set_velocity_linear(entity: Any, x: Any, y: Any) returns unknown

no docs found

Body2D.get_velocity_linear(entity: Any) returns unknown

no docs found

Body2D.set_velocity_angular(entity: Any, angle: Any) returns unknown

no docs found

Body2D.get_velocity_angular(entity: Any) returns unknown

no docs found

Body2D.set_damping_linear(entity: Any, linear_damping: Any) returns unknown

no docs found

Body2D.get_damping_linear(entity: Any) returns unknown

no docs found

Body2D.set_damping_angular(entity: Any, angular_damping: Any) returns unknown

no docs found

Body2D.get_damping_angular(entity: Any) returns unknown

no docs found

Body2D.apply_force(entity: Any, force_x: Any, force_y: Any, x: Any, y: Any, force_awake: Any) returns unknown

no docs found

Body2D.apply_force(entity: Any, force_x: Any, force_y: Any, x: Any, y: Any) returns unknown

no docs found

Body2D.apply_force(entity: Any, force_x: Any, force_y: Any, force_awake: Any) returns unknown

no docs found

Body2D.apply_force(entity: Any, force_x: Any, force_y: Any) returns unknown

no docs found

Body2D.apply_torque(entity: Any, torque: Any, force_awake: Any) returns unknown

no docs found

Body2D.apply_torque(entity: Any, torque: Any) returns unknown

no docs found

Body2D.apply_impulse_linear(entity: Any, impulse_x: Any, impulse_y: Any, x: Any, y: Any, force_awake: Any) returns unknown

no docs found

Body2D.apply_impulse_linear(entity: Any, impulse_x: Any, impulse_y: Any, x: Any, y: Any) returns unknown

no docs found

Body2D.apply_impulse_angular(entity: Any, impulse: Any, force_awake: Any) returns unknown

no docs found

Body2D.apply_impulse_angular(entity: Any, impulse: Any) returns unknown

no docs found

Body3D

import "luxe: world" for Body3D

no docs found


Body3D.create(entity: Any) returns unknown

no docs found

Body3D.destroy(entity: Any) returns unknown

no docs found

Body3D.has(entity: Any) returns unknown

no docs found

Body3D.create_heightfield(entity: Any, image: Any) returns unknown

no docs found

Body3D.create_collider_box(entity: Any, center: Any, size: Any, euler: Any, physics_asset: Any) returns unknown

no docs found

Body3D.create_collider_box(entity: Any, center: Any, size: Any, euler: Any) returns unknown

no docs found

Body3D.create_collider_sphere(entity: Any, center: Any, radius: Any, physics_asset: Any) returns unknown

no docs found

Body3D.create_collider_sphere(entity: Any, center: Any, radius: Any) returns unknown

no docs found

Body3D.create_collider_cylinder(entity: Any, center: Any, size: Any, physics_asset: Any) returns unknown

no docs found

Body3D.create_collider_cylinder(entity: Any, center: Any, size: Any) returns unknown

no docs found

Body3D.create_collider_capsule(entity: Any, center: Any, radius: Any, height: Any, physics_asset: Any) returns unknown

no docs found

Body3D.create_collider_capsule(entity: Any, center: Any, radius: Any, height: Any) returns unknown

no docs found

Body3D.create_collider_mesh(entity: Any, center: Any, euler: Any, collider_type: MeshColliderType, mesh_asset: Any, mesh_level: Any, physics_asset: Any) returns unknown

no docs found

Body3D.create_collider_mesh(entity: Any, center: Any, euler: Any, collider_type: MeshColliderType, mesh_asset: Any, mesh_level: Any) returns unknown

no docs found

Body3D.get_aabb(entity: Any) returns unknown

no docs found

Body3D.get_center(entity: Any) returns unknown

no docs found

Body3D.get_mass(entity: Any) returns unknown

no docs found

Body3D.get_inertia(entity: Any) returns unknown

no docs found

Body3D.set_physics_asset(entity: Any, physics_asset: Any) returns unknown

no docs found

Body3D.on(entity: Any, type: BodyEvent, fn: Any) returns unknown

no docs found

Body3D.off(entity: Any, handle: Any) returns unknown

no docs found

Body3D.set_channel(entity: Any, channel: Any) returns unknown

no docs found

Body3D.set_type(entity: Any, type: Any) returns unknown

no docs found

Body3D.get_type(entity: Any) returns unknown

no docs found

Body3D.set_sleeping_allowed(entity: Any, allowed: Any) returns unknown

no docs found

Body3D.get_sleeping_allowed(entity: Any) returns unknown

no docs found

Body3D.set_sleeping(entity: Any, sleep_state: Any) returns unknown

no docs found

Body3D.get_sleeping(entity: Any) returns unknown

no docs found

Body3D.set_active(entity: Any, active_state: Any) returns unknown

no docs found

Body3D.get_active(entity: Any) returns unknown

no docs found

Body3D.set_rotation_allowed(entity: Any, axis: Any) returns unknown

no docs found

Body3D.get_rotation_allowed(entity: Any) returns unknown

no docs found

Body3D.set_velocity_linear(entity: Any, x: Any, y: Any, z: Any) returns unknown

no docs found

Body3D.get_velocity_linear(entity: Any) returns unknown

no docs found

Body3D.set_velocity_angular(entity: Any, x: Any, y: Any, z: Any) returns unknown

no docs found

Body3D.get_velocity_angular(entity: Any) returns unknown

no docs found

Body3D.set_damping_linear(entity: Any, linear_damping: Any) returns unknown

no docs found

Body3D.get_damping_linear(entity: Any) returns unknown

no docs found

Body3D.set_damping_angular(entity: Any, angular_damping: Any) returns unknown

no docs found

Body3D.get_damping_angular(entity: Any) returns unknown

no docs found

Body3D.apply_force(entity: Any, force_x: Any, force_y: Any, force_z: Any, x: Any, y: Any, z: Any, force_awake: Any) returns unknown

no docs found

Body3D.apply_force(entity: Any, force_x: Any, force_y: Any, force_z: Any, x: Any, y: Any, z: Any) returns unknown

no docs found

Body3D.apply_force(entity: Any, force_x: Any, force_y: Any, force_z: Any, force_awake: Any) returns unknown

no docs found

Body3D.apply_force(entity: Any, force_x: Any, force_y: Any, force_z: Any) returns unknown

no docs found

Body3D.apply_torque(entity: Any, torque_x: Any, torque_y: Any, torque_z: Any, force_awake: Any) returns unknown

no docs found

Body3D.apply_torque(entity: Any, torque_x: Any, torque_y: Any, torque_z: Any) returns unknown

no docs found

Body3D.apply_impulse_linear(entity: Any, impulse_x: Any, impulse_y: Any, impulse_z: Any, x: Any, y: Any, z: Any, force_awake: Any) returns unknown

no docs found

Body3D.apply_impulse_linear(entity: Any, impulse_x: Any, impulse_y: Any, impulse_z: Any, x: Any, y: Any, z: Any) returns unknown

no docs found

Body3D.apply_impulse_angular(entity: Any, impulse_x: Any, impulse_y: Any, impulse_z: Any, force_awake: Any) returns unknown

no docs found

Body3D.apply_impulse_angular(entity: Any, impulse_x: Any, impulse_y: Any, impulse_z: Any) returns unknown

no docs found

BodyEvent

import "luxe: world" for BodyEvent

no docs found


BodyEvent.invalid returns unknown

no docs found

BodyEvent.overlap returns unknown

no docs found

BodyEvent.collide returns unknown

no docs found

BodyEvent.name(value: Any) returns unknown

no docs found

BodyEvent.from_string(value: Any) returns unknown

no docs found

BodyType

import "luxe: world" for BodyType

no docs found


BodyType.static_body returns unknown

no docs found

BodyType.dynamic_body returns unknown

no docs found

BodyType.kinematic_body returns unknown

no docs found

BodyType.name(value: Any) returns unknown

no docs found

BodyType.from_string(value: Any) returns 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)

Clock.create(world: Any, rate: Any, paused: Any) returns unknown

no docs found

Clock.create(world: Any, rate: Any) returns unknown

no docs found

Clock.time(world: Any, clock: Any) returns 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.


Entity.none returns Entity

An entity representing no value. Note, not for comparisons! Use Entity.valid(entity) for that

Entity.create(world: World) returns Entity

Creates a new entity in the given world.

var player = Entity.create(app.world)

Entity.create(world: World, name: String) returns Entity

Creates a new entity in the given world with the specified String name.

var player = Entity.create(app.world, "player")

Entity.valid(entity: Entity) returns 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.valid_handle(entity: Entity) returns 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.get_world(entity: Entity) returns World

Get the world a given entity belongs to

var world = Entity.get_world(entity)

Entity.get(uuid: String) returns 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.get_addressed_in(context_root: Entity, address: List) returns 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.get_addressed(relative_to: Entity, address: List) returns 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.resolve(relative_to: Entity, address: List) returns 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 a Link typically. Alias for Entity.get_addressed.

Entity.get_addressed_context(relative_to: Entity, address: List) returns 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.

Entity.get_named(world: World, name: String) returns Entity

Get the first entity from the given world with the name name. Which entity is returned is unspecified if there are multiple with the same name. If you need to test further use Entity.get_named_all. Returns null if no entity is found by that name.

var player = Entity.get_named(app.world, "player")

Entity.get_named_all(world: World, name: String) returns List

Get a list of all entities from the given world with the name name. 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.get_named_in(context: Entity, name: String) returns Entity

Get the first entity from the given context with the name name. 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 use Entity.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.get_named_all_in(context: Entity, name: String) returns List

Get a list of all entities from the given context with the name name. 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.get_name(entity: Entity) returns StringID

Get the name of a given entity as a hashed string ID. Use import "luxe: assets" for Strings with Strings.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.name(entity: Entity) returns 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.get_folder(entity: Entity) returns String

get the folder of this entity (used for nested display in a world outliner)

Entity.set_folder(entity: Entity, folder: String) returns None

set the folder of this entity (used for nested display in a world outliner)

Entity.get_asset_id(entity: Entity) returns String

get the asset ID of this entity (if it has one)

Entity.set_asset_id(entity: Entity, asset_id: String) returns None

set the asset ID of this entity (used for e.g editor)

Entity.get_context_asset_id(entity: Entity) returns String

get the context asset ID of this entity (if it has one)

Entity.set_context_asset_id(entity: Entity, asset_id: String) returns None

set the context asset ID of this entity (used for e.g editor)

Entity.get_context_type(entity: Entity) returns EntityContextType

get the context type for an entity

Entity.get_context_instance_uuid(entity: Entity) returns String

get the context uuid for a given entity. Entity should be EntityContextType scene or prototype or null is returned

Entity.get_context(entity: Entity) returns Entity

get the context this entity belongs to if any

Entity.get_context_origin(entity: Entity) returns 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.get_context_address(entity: Entity, context: Entity) returns List

get the address of the entity within a given context.

Entity.list_context_all(context: Entity) returns Set

Get all the entities this context created as a Set of entities.

Entity.list_context_direct(context: Entity) returns Set

Get all the entities this context created directly (rather than indirectly) as a Set of entities.

Entity.get_context_id(context: Entity) returns String

get the id of the given context.

Entity.get_origin_address(entity: Entity) returns List

get the address of the entity within it's origin context.

Entity.get_address(entity: Entity) returns List

get the address of the entity within it's origin context.

Entity.get_context_is_direct(context: Entity, entity: Entity) returns 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.init_into_context(entity: Entity, context: Entity) returns unknown

Initialize an entity into an existing context (typically editor related)

Entity.init_into_context(entity: Entity, context: Entity, address_uuid: UUID) returns unknown

Initialize an entity into an existing context with an address uuid (typically editor related)

Entity.note_add(entity: Entity, note: String) returns unknown

add a note to this entity (like a lower level tag)

Entity.note_remove(entity: Entity, note: String) returns unknown

remove a note to this entity

Entity.note_has(entity: Entity, note: String) returns unknown

returns true if this note exists, false otherwise

Entity.notes(entity: Entity) returns unknown

get all the notes on the given entity

Entity.set_name(entity: Entity, name: String) returns unknown

Set the name of a given entity.

Entity.set_name(player, "player")

Entity.get_uuid(entity: Entity) returns String

Get the unique ID as a string UUID for a given entity.

Entity.set_uuid(entity: Entity, uuid_string: String) returns unknown

Set the unique ID of a given entity. Typically used in special cases, not commonly used on the high level.

Entity.destroy(entity: Entity) returns 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.duplicate(entity: Entity) returns Entity

Duplicate the given entity. Returns a new entity with the same notes, folder, name and modifiers.

Entity.duplicate(entity: Entity, world: World) returns 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


EntityContextType.none returns unknown

no docs found

EntityContextType.scene returns unknown

no docs found

EntityContextType.prototype returns unknown

no docs found

EntityContextType.name(value: EntityContextType) returns String

no docs found

EntityEventType

import "luxe: world" for EntityEventType

no docs found


EntityEventType.unknown returns unknown

no docs found

EntityEventType.create returns unknown

no docs found

EntityEventType.destroy returns unknown

no docs found

EntityEventType.load returns unknown

no docs found

EntityEventType.unload returns unknown

no docs found

EntityEventType.modifier returns unknown

no docs found

EntityEventType.name(value: EntityEventType) returns String

no docs found

MeshColliderType

import "luxe: world" for MeshColliderType

no docs found


MeshColliderType.static_only returns unknown

no docs found

MeshColliderType.dynamic_convex returns unknown

no docs found

MeshColliderType.dynamic_concave returns unknown

no docs found

MeshColliderType.name(value: Any) returns unknown

no docs found

MeshColliderType.from_string(value: Any) returns unknown

no docs found

ModifierEventType

import "luxe: world" for ModifierEventType

no docs found


ModifierEventType.unknown returns unknown

no docs found

ModifierEventType.attach returns unknown

no docs found

ModifierEventType.detach returns unknown

no docs found

ModifierEventType.change returns unknown

no docs found

ModifierEventType.name(value: ModifierEventType) returns String

no docs found

ModifierSystem

import "luxe: world" for ModifierSystem

no docs found


ModifierSystem.priority returns unknown

no docs found

ModifierSystem.persist returns unknown

no docs found

ModifierSystem.count returns unknown

no docs found

ModifierSystem.field returns unknown

no docs found

ModifierSystem.items returns unknown

no docs found

ModifierSystem.world returns unknown

no docs found

ModifierSystem.each(fn: Any) returns unknown

no docs found

ModifierSystem.each(unique: Any, fn: Any) returns unknown

no docs found

ModifierSystem.find_entity(relative_entity: Any, uuid: Any) returns unknown

no docs found

ModifierSystem.create(entity: Any) returns unknown

no docs found

ModifierSystem.destroy(entity: Any) returns unknown

no docs found

ModifierSystem.get(entity: Any) returns unknown

no docs found

ModifierSystem.get(entity: Any, inst: Any) returns unknown

no docs found

ModifierSystem.get_slot_at(index: Any) returns unknown

no docs found

ModifierSystem.get_slot(entity: Any) returns unknown

no docs found

ModifierSystem.get_entity(slot: Any) returns unknown

no docs found

ModifierSystem.get_id(slot: Any) returns unknown

no docs found

ModifierSystem.get_id_hash(slot: Any) returns unknown

no docs found

ModifierSystem.set_entity(slot: Any, entity: Any) returns unknown

no docs found

ModifierSystem.editor(editor: Any) returns unknown

no docs found

ModifierSystem.init(world: Any) returns unknown

no docs found

ModifierSystem.tick(delta: Any) returns unknown

no docs found

ModifierSystem.destroy() returns unknown

no docs found

ModifierSystem.detached() returns unknown

no docs found

ModifierSystem.attached() returns unknown

no docs found

ModifierSystem.disable(entity: Any, instance: Any) returns unknown

no docs found

ModifierSystem.attach(entity: Any, instance: Any) returns unknown

no docs found

ModifierSystem.detach(entity: Any, instance: Any) returns unknown

no docs found

ModifierSystem.data returns unknown

no docs found

ModifierSystem.id returns unknown

no docs found

ModifierSystem.id=(v : Any) returns unknown

no docs found

ModifierSystem.on_init(world: Any, data: Any) returns unknown

no docs found

ModifierSystem.on_attached() returns unknown

no docs found

ModifierSystem.on_detached() returns unknown

no docs found

ModifierSystem.on_disabled(entities: Any, state: Any) returns unknown

no docs found

ModifierSystem.on_destroying(entities: Any) returns unknown

no docs found

ModifierSystem.on_destroyed(entities: Any) returns unknown

no docs found

ModifierSystem.on_destroy() returns unknown

no docs found

ModifierSystem.on_attach_block(block: Any, block_start: Any, block_end: Any, into: Any) returns unknown

no docs found

Modifiers

import "luxe: world" for Modifiers

no docs found


Modifiers.get_or_create_block(world: Any, module: Any, block_id: Any) returns unknown

no docs found

Modifiers.attach_uuid(module: Any, entity: Any, uuid: Any) returns unknown

no docs found

Modifiers.detach_uuid(module: Any, entity: Any, uuid: Any) returns unknown

no docs found

Modifiers.has(module: Any, entity: Any) returns unknown

no docs found

Modifiers.set_uuid(module: Any, entity: Any, uuid: Any) returns unknown

no docs found

Modifiers.get_uuid(module: Any, entity: Any) returns unknown

no docs found

Modifiers.get_attached(entity: Any) returns unknown

no docs found

Modifiers.get_attached_types(entity: Any) returns unknown

no docs found

Modifiers.get_entities(module: Any) returns unknown

no docs found

Modifiers.get_instances(module: Any) returns unknown

no docs found

Modifiers.get_module(uuid: Any) returns unknown

no docs found

Modifiers.get_entity(uuid: Any) returns unknown

no docs found

Modifiers.has_system_in_world(module: Any, world: Any) returns unknown

no docs found

Modifiers.get_system_in_world(module: Any, world: Any) returns unknown

no docs found

Modifiers.get(module: Any, entity: Any) returns unknown

no docs found

Modifiers.get_system(module: Any, entity: Any) returns unknown

no docs found

Modifiers.create(module: Any, entity: Any) returns unknown

no docs found

Modifiers.destroy(module: Any, entity: Any) returns unknown

no docs found

Modifiers.init(world: Any, modifier: Any, block: Any) returns unknown

no docs found

Modifiers.get_asset_compiler(type: Any) returns unknown

no docs found

Modifiers.get_compiler_for_input(modifier_id: Any) returns unknown

no docs found

Modifiers.get_data_block_type(modifier_id: Any) returns unknown

no docs found

Modifiers.get_input_block_type(modifier_id: Any) returns unknown

no docs found

Overlap

import "luxe: world" for Overlap

no docs found


Overlap.none returns unknown

no docs found

Overlap.begin returns unknown

no docs found

Overlap.end returns unknown

no docs found

Overlap.active returns unknown

no docs found

Overlap.name(value: Any) returns unknown

no docs found

Overlap.from_string(value: Any) returns unknown

no docs found

Physics2D

import "luxe: world" for Physics2D

no docs found


Physics2D.set_gravity(world: Any, x: Any, y: Any) returns unknown

no docs found

Physics3D

import "luxe: world" for Physics3D

no docs found


Physics3D.set_debug_draw(world: Any, state: Any) returns unknown

no docs found

Physics3D.set_gravity(world: Any, x: Any, y: Any, z: Any) returns unknown

no docs found

Physics3D.cast_ray(world: Any, from: Any, to: Any) returns unknown

no docs found

Physics3D.cast_shape(entity: Any, from: Any, to: Any, scale: Any) returns unknown

no docs found

Physics3D.cast_shape(entity: Any, from: Any, to: Any) returns unknown

no docs found

Physics3D.query_sphere(world: Any, center: Any, radius: Any) returns unknown

no docs found

Physics3D.query_box(world: Any, center: Any, size: Any) returns 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)

Prototype.destroy(entity: Entity) returns None

Destroys the prototype instance. (called on the root entity and will also destroy member entities that were instanced with it)

Prototype.has(entity: Entity) returns Bool

Get whether a entity has a prototype modifier (is a prototype instance root).

Prototype.get_type(entity: Entity) returns ID

Get the prototype id the prototype instance was spawned from.

Prototype.get_root(entity: Entity) returns 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.

Prototype.get_tree(entity: Entity) returns 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.

Prototype.has_tree(entity: Entity) returns Bool

Get whether the entity is part of a prototype instance.

Prototype.get_ref(entity: Entity, uuid: String) returns 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)

Prototype.get_ref_of(entity: Entity, target_entity: Entity) returns 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.

Prototype.get_named(entity: Entity, name: String) returns Entity

Get first entity in a prototype instance with a specific name.

Prototype.get_named_all(entity: Entity, name: String) returns Entity

Get all entities in a prototype instance with a specific name.

Prototype.entity_list(entity: Entity) returns List

Get a list of all entities that are part of a prototype instance.

Prototype.refs_list(entity: Entity) returns List

Get a list of all references (prototype-relative UUIDs) to entities within one prototype instance.

Prototype.create(world: World, prototype_id: String, instance_id: String) returns unknown

no docs found

Prototype.create(world: World, prototype_id: String, instance_id: String, position: Vec) returns unknown

no docs found

Prototype.create(world: World, prototype_id: String, instance_id: String, position: Vec, rotation: Vec) returns unknown

no docs found

Prototype.create(world: World, prototype_id: String, instance_id: String, position: Vec, rotation: Vec, scale: Vec) returns 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.


Scene.create(world: World, id: String) returns 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.

Scene.destroy(world: World, id: String) returns Entity

Destroy a scene by its id.

  Scene.create(app.world, "scenes/main")
  Scene.destroy(app.world, "scenes/main")

Scene.get_list(world: World) returns List

Get a list of scenes in a world. The list contains the IDs of the scenes (as string IDs).

Scene.exists(world: World, id: String) returns Bool

Check if a scene is currently instanced in a world.

Scene.entity_list(world: World, id: String) returns List

Get all entities that are part of an instanced scene.

Scene.entity_forget(world: World, id: String, entity: Entity) returns None

Stop associating an entity with a loaded scene.

Scene.set_id(world: World, id: String, new_id: String) returns 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)

UI.create(entity: Entity, x: Num, y: Num, w: Num, h: Num, z: Num, camera: Entity) returns None

Create a UI modifier on an Entity. The x y z arguments are the position relative to the world origin, or relative to the Transform on the same entity if one exists. w and h are the width and the height of the canvas, this is both used for the mask texture (and in UIRenderMode.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.

UI.destroy(entity: Entity) returns None

Remove a UI modifier from an entity. This also destroys all controls on that UI.

UI.has(entity: Entity) returns Bool

Get whether an Entity has an UI modifier attached.

UI.commit(entity: Entity) returns None

Request all changes to the UI are committed before rendering happens

UI.commit_now(entity: Entity) returns None

Commit all changes to the UI immediately

UI.event_cancel(entity: Entity, event_id: ID) returns None

Cancel an event.

UI.event_cancelled(entity: Entity, event_id: ID) returns Bool

Check whether an event was cancelled before.

UI.set_camera(entity: Entity, camera: Entity) returns 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.

UI.set_render_mode(entity: Entity, mode: UIRenderMode) returns None

Set the render mode of the UI canvas.

UIRenderMode.world renders the controls directly into the world, while UIRenderMode.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, though UIRenderMode.world can lead to more sharp results and slightly better performance.

UI.set_material_basis(entity: Entity, solid: String, text: String) returns 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.

UI.set_bounds(entity: Entity, x: Num, y: Num, w: Num, h: Num, z: Num) returns None

Set size and position of an UI modifier. The x y z arguments are the position relative to the world origin, or relative to the Transform on the same entity if one exists. w and h are the width and the height of the canvas, this is both used for the mask texture (and in UIRenderMode.image the ui rendertarget) as well as the (unscaled) size of the UI in worldspace.

UI.get_pos(entity: Entity) returns Vec

Get position of an UI modifier.

UI.get_opacity(entity: Entity) returns Num

Get overall UI opacity

UI.set_opacity(entity: Entity, opacity: Num) returns Num

Set overall UI opacity

UI.get_size(entity: Entity) returns Vec

Get size of an UI modifier.

UI.get_debug_control(entity: Entity) returns Control

no docs found

UI.get_debug_draw_depth(entity: Entity) returns Num

no docs found

UI.get_input_node(entity: Entity) returns String

no docs found

UI.set_input_node(entity: Entity, input_node_id: String) returns None

no docs found

UI.set_layout_mode(entity: Entity, mode: UILayoutMode) returns None

Set the layout mode of the UI.

By default this is UILayoutMode.none, which will do no extra layouting and ignore Control margin, behave and contain.

UILayoutMode.flex is the default layout implementation which will follow the Control 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)

UI.set_debug_mode(entity: Entity, mode: UIDebugMode) returns None

no docs found

UI.any_marked() returns Bool

Returns true if any UI has a marked control (any control with input under the mouse)

UI.any_focused() returns Bool

Returns true if any UI has a focused control

UI.get_focused(entity: Entity) returns 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.

UI.get_captured(entity: Entity) returns 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.

UI.get_marked(entity: Entity) returns Control

Get marked control, null if none is marked. A control being marked means it is hovered over and can be focused.

UI.get_control_count(entity: Entity) returns Num

Get amount of controls in a UI.

UI.get_control(entity: Entity, index: Num) returns Control

Get a control in a UI by its index. Useful for iterating over all controls.

UI.focus_invalidate(entity: Entity) returns None

Unfocus whatever is focussed in a specific UI.

UI.focus(control: Control) returns 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.

UI.unfocus(control: Control) returns None

Unfocus a specific control. If the control is not the focused control in the UI, this does nothing.

UI.mark(control: Control) returns 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.

UI.unmark(control: Control) returns None

Unmark a specific control. If the control is not the marked control in the UI, this does nothing.

UI.capture(control: Control) returns None

Capture a control. Until uncaptured all inputs will only go to this control.

UI.uncapture(control: Control) returns None

Uncapture a control and have inputs be distributed regularly.

UI.bring_to_front(control: Control) returns None

Bring the control to the front in its current context (globally in the UI or within its parent if its a child)

UI.control_at_point(entity: Entity, x: Num, y: Num) returns Control

Get the highest control at a position.

UI.mouse_to_canvas(entity: Entity, x: Num, y: Num) returns Float2

Translate from mouse position on screen to canvas coordinates. Uses the set canvas camera.

UI.dump(ui: Entity) returns None

Write a bunch of information about the UI and its controls into the console.

UI.spawn(asset_id: String, parent: Control, instance_id: String) returns None

Spawn controls from a ui asset. Puts newly spawned controls into a parent control.

UI.make(ui: Entity, asset: String, instance_id: String) returns Control

Spawn controls from a ui asset. Creates new root for newly spawned controls and returns that root control.

UI.draw_depth_of(control: Control, index: Num) returns None

no docs found

UI.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) returns None

no docs found

UI.draw_text(control: Control, x: Num, y: Num, z: Num, string: String, size: Num, font: String, color: Color, align: TextAlign, align_vertical: TextAlign) returns None

no docs found

UI.draw_image(control: Control, x: Num, y: Num, z: Num, w: Num, h: Num, angle: Num, color: Color, uv: Vec, image: Image, flags: UIImageFlags) returns None

no docs found

UI.draw_image(control: Control, x: Num, y: Num, z: Num, w: Num, h: Num, angle: Num, color: Color, uv: Vec, image: Image) returns None

no docs found

UI.draw_quad(control: Control, x: Num, y: Num, z: Num, w: Num, h: Num, angle: Num, color: Color) returns None

no docs found

UI.draw_circle(control: Control, ox: Num, oy: Num, oz: Num, rx: Num, ry: Num, start_angle: Num, end_angle: Num, smoothness: Num, color: Color) returns None

no docs found

UI.draw_line(control: Control, x1: Num, y1: Num, x2: Num, y2: Num, z: Num, style: PathStyle) returns None

no docs found

UI.draw_rect(control: Control, x: Num, y: Num, z: Num, w: Num, h: Num, angle: Num, style: PathStyle) returns None

no docs found

UI.draw_rect_detailed(control: Control, x: Num, y: Num, z: Num, w: Num, h: Num, angle: Num, radius: Num, smoothness: Num, style: PathStyle) returns None

no docs found

UI.draw_quad_detailed(control: Control, x: Num, y: Num, z: Num, w: Num, h: Num, angle: Num, radius: Num, smoothness: Num, color: Color) returns None

no docs found

UI.draw_ring(control: Control, ox: Num, oy: Num, oz: Num, rx: Num, ry: Num, start_angle: Num, end_angle: Num, smoothness: Num, style: PathStyle) returns None

no docs found

UI.draw_path(control: Control, points: List, style: PathStyle, closed: Bool) returns None

no docs found

UI.events_emit(control: Control, type: UIEvent) returns None

no docs found

UI.events_emit(control: Control, type: UIEvent, data: Any) returns None

no docs found

UI.events_emit(control: Control, type: UIEvent, data: Any, data_before: Any) returns None

no docs found

UIBehave

import "luxe: world" for UIBehave

no docs found


UIBehave.left returns unknown

Item anchors to the item to its left or left side of parent

UIBehave.top returns unknown

Item anchors to the item above it or top side of parent

UIBehave.right returns unknown

Item anchors to the item to its right or right side of parent

UIBehave.bottom returns unknown

Item anchors to the item below it or bottom side of parent

UIBehave.hfill returns unknown

Item anchors to both left and right item or parent borders

UIBehave.vfill returns unknown

Item anchors to both top and bottom item or parent borders

UIBehave.hcenter returns unknown

Center item horizontally, with left margin as offset

UIBehave.vcenter returns unknown

Center item vertically, with top margin as offset

UIBehave.center returns unknown

Center item in both directions, with left/top margin as offset

UIBehave.fill returns unknown

Anchor item to all four directions

UIBehave.break_line returns unknown

no docs found

UIClear

import "luxe: world" for UIClear

no docs found


UIClear.destroy returns unknown

no docs found

UIClear.remove returns unknown

no docs found

UIClear.set_invisible returns unknown

no docs found

UIClear.remove_set_invisible returns unknown

no docs found

UIContain

import "luxe: world" for UIContain

no docs found


UIContain.row returns unknown

Items go from left to right

UIContain.column returns unknown

Items go from top to bottom

UIContain.layout returns unknown

Use Free Layout model

UIContain.flex returns unknown

Use Flex Layout model

UIContain.nowrap returns unknown

Stays on a single line

UIContain.wrap returns unknown

Wraps to multiple lines, wrapping left to right

UIContain.start returns unknown

Items begin at start of row/column

UIContain.middle returns unknown

Items begin at middle of row/column

UIContain.end returns unknown

Items begin at end of row/column

UIContain.justify returns unknown

Insert spacing between items to stretch elements across whole row/column

UIContain.vfit returns unknown

Items stretch height to fill vertical space

UIContain.hfit returns unknown

Items stretch width to fill horizontal space

UIDebugMode

import "luxe: world" for UIDebugMode

no docs found


UIDebugMode.none returns unknown

no docs found

UIDebugMode.basic returns unknown

no docs found

UIDrop

import "luxe: world" for UIDrop

no docs found


UIDrop.start returns unknown

no docs found

UIDrop.end returns unknown

no docs found

UIDrop.move returns unknown

no docs found

UIDrop.drop returns unknown

no docs found

UIEvent

import "luxe: world" for UIEvent

The built in UI events that all controls can potentially use.


UIEvent.name(value: Any) returns unknown

Converts a UIEvent value to a readable name.

Log.print(UIEvent.name(UIEvent.move)) //prints "move"

UIEvent.unknown returns unknown

An event of unknown type, invalid. This is the default value.

UIEvent.enter returns 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!")
}

UIEvent.exit returns 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!")
}

UIEvent.press returns unknown

An input press event (e.g mouse button was pressed down). a.k.a "down" Sends event.x, event.y and event.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)`")
}

UIEvent.release returns unknown

An input release event (e.g mouse button was released). a.k.a "up" Sends event.x, event.y and event.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)`")
}

UIEvent.scroll returns unknown

A scroll event (e.g mouse wheel). Sends event.x, event.y where x is the horizontal scroll amount, and y is the vertical scroll amount.

if(event.type == UIEvent.scroll) {
  Log.print("scroll amount `%(event.x)`,`%(event.y)`")
}

UIEvent.move returns 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)`")
}

UIEvent.key returns unknown

A key input event. Sends a few useful values:

  • event.key - a Key value
  • event.scan - a Scan value
  • event.mod - a ModState value
  • event.down - a Bool value, whether the key is down or not
  • event.repeat - a Bool value, whether the event is from a key repeat
if(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!")
  }
}

UIEvent.text returns 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 displayed
  • event.text_start - the start of the modified text
  • event.text_length - the length of the modified text
  • event.text_type - a TextEvent type (edit or input)

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), a TextEvent.input is sent with the text.

UIEvent.focus returns unknown

A control has gained focus. Sends no additional data in the event.

if(event.type == UIEvent.focus) {
  Log.print("gained focus!")
}

UIEvent.unfocus returns unknown

A control has lost focus. Sends no additional data in the event.

if(event.type == UIEvent.unfocus) {
  Log.print("lost focus!")
}

UIEvent.capture returns unknown

A control has been captured.

if(event.type == UIEvent.capture) {
  Log.print("gained input capture!")
}

UIEvent.uncapture returns unknown

A control has lost capture status.

if(event.type == UIEvent.uncapture) {
  Log.print("lost input capture!")
}

UIEvent.commit returns 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!")
}

UIEvent.destroy returns 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!")
}

UIEvent.language returns 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..")
}

UIEvent.change returns 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)`!")
}

UIEvent.bounds returns unknown

A control has changed bounds (note: this may not be working as intended right now). Sends event.dx, event.dy and event.dw, event.dh where d means delta. 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!")
}

UIEvent.drag returns 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


UIImageFit.fill returns unknown

no docs found

UIImageFit.contain returns unknown

no docs found

UIImageFit.cover returns unknown

no docs found

UIImageFit.keep_width returns unknown

no docs found

UIImageFit.keep_height returns unknown

no docs found

UIImageFlags

import "luxe: world" for UIImageFlags

no docs found


UIImageFlags.none returns unknown

uses linear interpolation samplers, interpolating smoothly between pixels.

UIImageFlags.pixelated returns unknown

uses nearest neighbor samplers, leading to an interpolated look.

UIImageFlags.use_mips returns unknown

uses trilinear interpolation samplers, interpolating smoothly between pixels and mip levels.

UILayoutMode

import "luxe: world" for UILayoutMode

no docs found


UILayoutMode.none returns unknown

no docs found

UILayoutMode.flex returns unknown

no docs found

UIRenderMode

import "luxe: world" for UIRenderMode

no docs found


UIRenderMode.unknown returns unknown

no docs found

UIRenderMode.image returns unknown

no docs found

UIRenderMode.world returns unknown

no docs found

WorldEventType

import "luxe: world" for WorldEventType

no docs found


WorldEventType.unknown returns unknown

no docs found

WorldEventType.create returns unknown

no docs found

WorldEventType.destroy returns unknown

no docs found

WorldEventType.tick returns unknown

no docs found

WorldEventType.modifier_tick returns unknown

no docs found

WorldEventType.name(value: WorldEventType) returns String

no docs found

WorldRenderDesc

import "luxe: world" for WorldRenderDesc

no docs found


WorldRenderDesc.camera returns unknown

no docs found

WorldRenderDesc.camera=(v : Any) returns unknown

no docs found

WorldRenderDesc.camera(v: Any) returns unknown

no docs found

WorldRenderDesc.cull_camera returns unknown

no docs found

WorldRenderDesc.cull_camera=(v : Any) returns unknown

no docs found

WorldRenderDesc.cull_camera(v: Any) returns unknown

no docs found

WorldRenderDesc.new() returns WorldRenderDesc

no docs found