luxe: world
- Clock
- Entity
- EntityContextType
- EntityEventType
- ModifierEventType
- UI
- UIBehave
- UIClear
- UIContain
- UIDebugMode
- UIDrop
- UIEvent
- UIImageFit
- UIImageFlags
- UILayoutMode
- UIRenderMode
- WorldEventType
- WorldRenderDesc
import "luxe: world" for Clockno docs found
Clock.create(…)
Section titled “Clock.create(…)”Clock.create(world : World, rate : Num, paused : Bool) : Clockno docs found
Clock.create(..)
Section titled “Clock.create(..)”Clock.create(world : World, rate : Num) : Clockno docs found
Clock.time(..)
Section titled “Clock.time(..)”Clock.time(world : World, clock : Clock) : Numno docs found
Entity
Section titled “Entity”import "luxe: world" for EntityAnything 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
transformmodifier 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
Section titled “Entity.none”Entity.none : EntityAn entity representing no value. Note, not for comparisons! Use Entity.valid(entity) for that
Entity.create(.)
Section titled “Entity.create(.)”Entity.create(world : World) : EntityCreates a new
entityin the givenworld.var player = Entity.create(app.world)
Entity.create(..)
Section titled “Entity.create(..)”Entity.create(world : World, name : String) : EntityCreates a new
entityin the givenworldwith the specifiedStringname.var player = Entity.create(app.world, "player")
Entity.valid(.)
Section titled “Entity.valid(.)”Entity.valid(entity : Entity) : BoolChecks 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(.)
Section titled “Entity.valid_handle(.)”Entity.valid_handle(entity : Entity) : BoolChecks if the given variable references a valid
entityhandle. 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(.)
Section titled “Entity.get_world(.)”Entity.get_world(entity : Entity) : WorldGet the
worlda givenentitybelongs tovar world = Entity.get_world(entity)
Entity.get(.)
Section titled “Entity.get(.)”Entity.get(uuid : String) : EntityGet 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(..)
Section titled “Entity.get_addressed_in(..)”Entity.get_addressed_in(context_root : Entity, address : List) : EntityFind an entity by
addressin 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(..)
Section titled “Entity.get_addressed(..)”Entity.get_addressed(relative_to : Entity, address : List) : EntityFind an entity by
addressrelative 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(..)
Section titled “Entity.resolve(..)”Entity.resolve(relative_to : Entity, address : List) : EntityFind an entity by
addressrelative 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 aLinktypically. Alias forEntity.get_addressed.
Entity.get_relative_address(..)
Section titled “Entity.get_relative_address(..)”Entity.get_relative_address(entity : Entity, relative_to : Entity) : ListGet the address of one entity relative to another. Typically used in e.g the editor to resolve an address of a link field. Returns the address as a list of UUIDs.
Entity.get_addressed_context(..)
Section titled “Entity.get_addressed_context(..)”Entity.get_addressed_context(relative_to : Entity, address : List) : EntityFind an entity by
addressrelative 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_with_in(..)
Section titled “Entity.get_with_in(..)”Entity.get_with_in(context : Entity, modifier_id : String) : EntityGet the first entity found in the context that has the given modifier attached. Searches all entities the context has loaded and returns the first one found. Note: Modifiers expose
Thing.idwhich you would use here from the type.
Entity.get_with(..)
Section titled “Entity.get_with(..)”Entity.get_with(relative_to : Entity, modifier_id : String) : EntityGet the first entity found in the context that has the given modifier attached. Searches all entities within the context this entity is inside of (e.g prototype). Note: Modifiers expose
Thing.idwhich you would use here from the type.
Entity.get_with_all_in(..)
Section titled “Entity.get_with_all_in(..)”Entity.get_with_all_in(context : Entity, modifier_id : String) : SetGet the set of entities found in the context that have the given modifier attached. Searches all entities the context and returns the list as a Set. Note: Modifiers expose
Thing.idwhich you would use here from the type.
Entity.get_with_all(..)
Section titled “Entity.get_with_all(..)”Entity.get_with_all(relative_to : Entity, modifier_id : String) : SetGet the set of entities found in the context that have the given modifier attached. Searches all entities the context and returns the list as a Set. Note: Modifiers expose
Thing.idwhich you would use here from the type.
Entity.get_named(..)
Section titled “Entity.get_named(..)”Entity.get_named(world : World, name : String) : EntityGet the first
entityfrom the givenworldwith 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")
Entity.get_named_all(..)
Section titled “Entity.get_named_all(..)”Entity.get_named_all(world : World, name : String) : ListGet a list of all
entitiesfrom the givenworldwith 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.get_named_in(..)
Section titled “Entity.get_named_in(..)”Entity.get_named_in(context : Entity, name : String) : EntityGet the first
entityfrom the givencontextwith 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.get_named_all_in(..)
Section titled “Entity.get_named_all_in(..)”Entity.get_named_all_in(context : Entity, name : String) : ListGet a list of all
entitiesfrom the givencontextwith 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.create(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(.)
Section titled “Entity.get_name(.)”Entity.get_name(entity : Entity) : StringIDGet the name of a given
entityas a hashed string ID. Useimport "luxe: assets" for StringswithStrings.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(.)
Section titled “Entity.name(.)”Entity.name(entity : Entity) : StringGet the name of a given
entityas 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.set_visible(..)
Section titled “Entity.set_visible(..)”Entity.set_visible(entity : Entity, state : Bool) : unknownSet the entity visibility flag, which will remove associated geometry from rendering. Only geometry intentionally associated with this entity is affected. Sometimes geometry is created and not connected (intentionally or otherwise, see
World.render_set_add), this won’t affect that geometry.
Entity.set_visible(…)
Section titled “Entity.set_visible(…)”Entity.set_visible(entity : Entity, state : Bool, tag : String) : unknownSet the entity visibility flag, which will remove associated geometry from rendering. Only geometry intentionally associated with this entity is affected. Sometimes geometry is created and not connected (intentionally or otherwise, see
World.render_set_add), this won’t affect that geometry.The tag means the state is not a simple binary, rather it is a multi-toggle concept. e.g if you can toggle visible from “code” and from “ui” tags, unhiding via UI won’t unhide it if the code still wants it hidden. This can be thought of as a counter, it will be hidden as long as the number of uses asking for it to be hidden > 0.
Entity.get_visible(.)
Section titled “Entity.get_visible(.)”Entity.get_visible(entity : Entity) : unknownGet the entity visibility state
Entity.get_visible(..)
Section titled “Entity.get_visible(..)”Entity.get_visible(entity : Entity, tag : String) : unknownGet the entity visibility state for the given tag
Entity.get_visual_obb(.)
Section titled “Entity.get_visual_obb(.)”Entity.get_visual_obb(entity : Entity) : ListReturns the combined visual bounds of this and entity created by this entity (in the obb shape, e.g 8 corner points)
Entity.get_folder(.)
Section titled “Entity.get_folder(.)”Entity.get_folder(entity : Entity) : Stringget the folder of this entity (used for nested display in a world outliner)
Entity.set_folder(..)
Section titled “Entity.set_folder(..)”Entity.set_folder(entity : Entity, folder : String) : Noneset the folder of this entity (used for nested display in a world outliner)
Entity.get_asset_id(.)
Section titled “Entity.get_asset_id(.)”Entity.get_asset_id(entity : Entity) : Stringget the asset ID of this entity (if it has one)
Entity.set_asset_id(..)
Section titled “Entity.set_asset_id(..)”Entity.set_asset_id(entity : Entity, asset_id : String) : Noneset the asset ID of this entity (used for e.g editor)
Entity.get_context_asset_id(.)
Section titled “Entity.get_context_asset_id(.)”Entity.get_context_asset_id(entity : Entity) : Stringget the context asset ID of this entity (if it has one)
Entity.set_context_asset_id(..)
Section titled “Entity.set_context_asset_id(..)”Entity.set_context_asset_id(entity : Entity, asset_id : String) : Noneset the context asset ID of this entity (used for e.g editor)
Entity.get_context_type(.)
Section titled “Entity.get_context_type(.)”Entity.get_context_type(entity : Entity) : EntityContextTypeget the context type for an entity
Entity.get_context_instance_uuid(.)
Section titled “Entity.get_context_instance_uuid(.)”Entity.get_context_instance_uuid(entity : Entity) : Stringget the context uuid for a given entity. Entity should be EntityContextType
sceneorprototypeor null is returned
Entity.get_context_data_uuid(.)
Section titled “Entity.get_context_data_uuid(.)”Entity.get_context_data_uuid(entity : Entity) : Stringget the context data uuid for a given entity. Entity should be EntityContextType
sceneorprototypeor null is returned
Entity.get_context(.)
Section titled “Entity.get_context(.)”Entity.get_context(entity : Entity) : Entityget the context this entity belongs to if any
Entity.get_context_origin(.)
Section titled “Entity.get_context_origin(.)”Entity.get_context_origin(entity : Entity) : Entityget 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(..)
Section titled “Entity.get_context_address(..)”Entity.get_context_address(entity : Entity, context : Entity) : Listget the address of the entity within a given context.
Entity.list_context_all(.)
Section titled “Entity.list_context_all(.)”Entity.list_context_all(context : Entity) : SetGet all the entities this context created as a Set of entities.
Entity.list_context_direct(.)
Section titled “Entity.list_context_direct(.)”Entity.list_context_direct(context : Entity) : SetGet all the entities this context created directly (rather than indirectly) as a Set of entities.
Entity.get_context_id(.)
Section titled “Entity.get_context_id(.)”Entity.get_context_id(context : Entity) : Stringget the id of the given context.
Entity.get_origin_address(.)
Section titled “Entity.get_origin_address(.)”Entity.get_origin_address(entity : Entity) : Listget the address of the entity within it’s origin context.
Entity.get_address(.)
Section titled “Entity.get_address(.)”Entity.get_address(entity : Entity) : Listget the address of the entity within it’s origin context.
Entity.get_context_is_direct(..)
Section titled “Entity.get_context_is_direct(..)”Entity.get_context_is_direct(context : Entity, entity : Entity) : Boolreturns 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(..)
Section titled “Entity.init_into_context(..)”Entity.init_into_context(entity : Entity, context : Entity) : unknownInitialize an entity into an existing context (typically editor related)
Entity.init_into_context(…)
Section titled “Entity.init_into_context(…)”Entity.init_into_context(entity : Entity, context : Entity, address_uuid : UUID) : unknownInitialize an entity into an existing context with an address uuid (typically editor related)
Entity.note_add(..)
Section titled “Entity.note_add(..)”Entity.note_add(entity : Entity, note : String) : unknownadd a note to this entity (like a lower level tag)
Entity.note_remove(..)
Section titled “Entity.note_remove(..)”Entity.note_remove(entity : Entity, note : String) : unknownremove a note to this entity
Entity.note_has(..)
Section titled “Entity.note_has(..)”Entity.note_has(entity : Entity, note : String) : unknownreturns true if this note exists, false otherwise
Entity.notes(.)
Section titled “Entity.notes(.)”Entity.notes(entity : Entity) : unknownget all the notes on the given entity
Entity.set_name(..)
Section titled “Entity.set_name(..)”Entity.set_name(entity : Entity, name : String) : unknownSet the name of a given
entity.Entity.set_name(player, "player")
Entity.get_uuid(.)
Section titled “Entity.get_uuid(.)”Entity.get_uuid(entity : Entity) : StringGet the unique ID as a string UUID for a given
entity.
Entity.set_uuid(..)
Section titled “Entity.set_uuid(..)”Entity.set_uuid(entity : Entity, uuid_string : String) : unknownSet the unique ID of a given
entity. Typically used in special cases, not commonly used on the high level.
Entity.destroy(.)
Section titled “Entity.destroy(.)”Entity.destroy(entity : Entity) : unknownDestroy 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(.)
Section titled “Entity.duplicate(.)”Entity.duplicate(entity : Entity) : EntityDuplicate the given
entity. Returns a new entity with the same notes, folder, name and modifiers.
Entity.duplicate(..)
Section titled “Entity.duplicate(..)”Entity.duplicate(entity : Entity, world : World) : EntityDuplicate the given
entityinto 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
Section titled “EntityContextType”import "luxe: world" for EntityContextTypeWhich kind of context is an entity the root of? Default is
none.
EntityContextType.none
Section titled “EntityContextType.none”EntityContextType.none : unknownno docs found
EntityContextType.scene
Section titled “EntityContextType.scene”EntityContextType.scene : unknownno docs found
EntityContextType.prototype
Section titled “EntityContextType.prototype”EntityContextType.prototype : unknownno docs found
EntityContextType.name(.)
Section titled “EntityContextType.name(.)”EntityContextType.name(value : EntityContextType) : Stringno docs found
EntityEventType
Section titled “EntityEventType”import "luxe: world" for EntityEventTypeno docs found
EntityEventType.unknown
Section titled “EntityEventType.unknown”EntityEventType.unknown : unknownno docs found
EntityEventType.create
Section titled “EntityEventType.create”EntityEventType.create : unknownno docs found
EntityEventType.destroy
Section titled “EntityEventType.destroy”EntityEventType.destroy : unknownno docs found
EntityEventType.load
Section titled “EntityEventType.load”EntityEventType.load : unknownno docs found
EntityEventType.unload
Section titled “EntityEventType.unload”EntityEventType.unload : unknownno docs found
EntityEventType.modifier
Section titled “EntityEventType.modifier”EntityEventType.modifier : unknownno docs found
EntityEventType.name(.)
Section titled “EntityEventType.name(.)”EntityEventType.name(value : EntityEventType) : Stringno docs found
ModifierEventType
Section titled “ModifierEventType”import "luxe: world" for ModifierEventTypeno docs found
ModifierEventType.unknown
Section titled “ModifierEventType.unknown”ModifierEventType.unknown : unknownno docs found
ModifierEventType.attach
Section titled “ModifierEventType.attach”ModifierEventType.attach : unknownno docs found
ModifierEventType.detach
Section titled “ModifierEventType.detach”ModifierEventType.detach : unknownno docs found
ModifierEventType.change
Section titled “ModifierEventType.change”ModifierEventType.change : unknownno docs found
ModifierEventType.name(.)
Section titled “ModifierEventType.name(.)”ModifierEventType.name(value : ModifierEventType) : Stringno docs found
import "luxe: world" for UIA
UImodifier holds controls which define a 2d user interface with images, buttons, sliders, etc…//create ui modifier in ui worldvar ui = Entity.create(app.ui)UI.create(ui, 0, 0, world.width, world.height, 0, app.ui_camera)//add controlsvar control = Control.create(ui)//more control stuff//then rebuild the UIUI.commit(ui)
UI.create(…)
Section titled “UI.create(…)”UI.create(entity : Entity, x : Num, y : Num, w : Num, h : Num, z : Num, camera : Entity) : NoneCreate a UI modifier on an Entity. The
xyzarguments are the position relative to the world origin, or relative to theTransformon the same entity if one exists.wandhare the width and the height of the canvas, this is both used for the mask texture (and inUIRenderMode.imagethe ui rendertarget) as well as the (unscaled) size of the UI in worldspace.cameradescribes 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(.)
Section titled “UI.destroy(.)”UI.destroy(entity : Entity) : NoneRemove a
UImodifier from an entity. This also destroys all controls on thatUI.
UI.has(.)
Section titled “UI.has(.)”UI.has(entity : Entity) : BoolGet whether an Entity has an
UImodifier attached.
UI.commit(.)
Section titled “UI.commit(.)”UI.commit(entity : Entity) : NoneRequest all changes to the UI are committed before rendering happens
UI.commit_now(.)
Section titled “UI.commit_now(.)”UI.commit_now(entity : Entity) : NoneCommit all changes to the UI immediately
UI.event_cancel(..)
Section titled “UI.event_cancel(..)”UI.event_cancel(entity : Entity, event_id : ID) : NoneCancel an event.
UI.event_cancelled(..)
Section titled “UI.event_cancelled(..)”UI.event_cancelled(entity : Entity, event_id : ID) : BoolCheck whether an event was cancelled before.
UI.set_camera(..)
Section titled “UI.set_camera(..)”UI.set_camera(entity : Entity, camera : Entity) : NoneSet 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(..)
Section titled “UI.set_render_mode(..)”UI.set_render_mode(entity : Entity, mode : UIRenderMode) : NoneSet the render mode of the UI canvas.
UIRenderMode.worldrenders the controls directly into the world, whileUIRenderMode.imagefirst renders them to an intermediate texture and then renders that.
UIRenderMode.imageis the default as it can avoid artifacts and works in more circumstances, thoughUIRenderMode.worldcan lead to more sharp results and slightly better performance.
UI.set_material_basis(…)
Section titled “UI.set_material_basis(…)”UI.set_material_basis(entity : Entity, solid : String, text : String) : NoneSet 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(…)
Section titled “UI.set_bounds(…)”UI.set_bounds(entity : Entity, x : Num, y : Num, w : Num, h : Num, z : Num) : NoneSet size and position of an
UImodifier. Thexyzarguments are the position relative to the world origin, or relative to theTransformon the same entity if one exists.wandhare the width and the height of the canvas, this is both used for the mask texture (and inUIRenderMode.imagethe ui rendertarget) as well as the (unscaled) size of the UI in worldspace.
UI.get_pos(.)
Section titled “UI.get_pos(.)”UI.get_pos(entity : Entity) : VecGet position of an
UImodifier.
UI.get_opacity(.)
Section titled “UI.get_opacity(.)”UI.get_opacity(entity : Entity) : NumGet overall UI opacity
UI.set_opacity(..)
Section titled “UI.set_opacity(..)”UI.set_opacity(entity : Entity, opacity : Num) : NumSet overall UI opacity
UI.get_size(.)
Section titled “UI.get_size(.)”UI.get_size(entity : Entity) : VecGet size of an
UImodifier.
UI.get_debug_control(.)
Section titled “UI.get_debug_control(.)”UI.get_debug_control(entity : Entity) : Controlno docs found
UI.get_debug_draw_depth(.)
Section titled “UI.get_debug_draw_depth(.)”UI.get_debug_draw_depth(entity : Entity) : Numno docs found
UI.get_input_node(.)
Section titled “UI.get_input_node(.)”UI.get_input_node(entity : Entity) : Stringno docs found
UI.set_input_node(..)
Section titled “UI.set_input_node(..)”UI.set_input_node(entity : Entity, input_node_id : String) : Noneno docs found
UI.set_layout_mode(..)
Section titled “UI.set_layout_mode(..)”UI.set_layout_mode(entity : Entity, mode : UILayoutMode) : NoneSet the layout mode of the UI.
By default this is
UILayoutMode.none, which will do no extra layouting and ignoreControlmargin, behave and contain.
UILayoutMode.flexis the default layout implementation which will follow theControlmargin, 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(..)
Section titled “UI.set_debug_mode(..)”UI.set_debug_mode(entity : Entity, mode : UIDebugMode) : Noneno docs found
UI.any_marked(.)
Section titled “UI.any_marked(.)”UI.any_marked() : BoolReturns true if any UI has a marked control (any control with input under the mouse)
UI.any_focused(.)
Section titled “UI.any_focused(.)”UI.any_focused() : BoolReturns true if any UI has a focused control
UI.get_focused(.)
Section titled “UI.get_focused(.)”UI.get_focused(entity : Entity) : ControlGet 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(.)
Section titled “UI.get_captured(.)”UI.get_captured(entity : Entity) : ControlGet captured control,
nullif 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(.)
Section titled “UI.get_marked(.)”UI.get_marked(entity : Entity) : ControlGet marked control,
nullif none is marked. A control being marked means it is hovered over and can be focused.
UI.get_control_count(.)
Section titled “UI.get_control_count(.)”UI.get_control_count(entity : Entity) : NumGet amount of controls in a
UI.
UI.get_control(..)
Section titled “UI.get_control(..)”UI.get_control(entity : Entity, index : Num) : ControlGet a control in a
UIby its index. Useful for iterating over all controls.
UI.focus_invalidate(.)
Section titled “UI.focus_invalidate(.)”UI.focus_invalidate(entity : Entity) : NoneUnfocus whatever is focussed in a specific
UI.
UI.focus(.)
Section titled “UI.focus(.)”UI.focus(control : Control) : NoneFocus 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(.)
Section titled “UI.unfocus(.)”UI.unfocus(control : Control) : NoneUnfocus a specific control. If the control is not the focused control in the UI, this does nothing.
UI.mark(.)
Section titled “UI.mark(.)”UI.mark(control : Control) : NoneMark 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(.)
Section titled “UI.unmark(.)”UI.unmark(control : Control) : NoneUnmark a specific control. If the control is not the marked control in the UI, this does nothing.
UI.capture(.)
Section titled “UI.capture(.)”UI.capture(control : Control) : NoneCapture a control. Until uncaptured all inputs will only go to this control.
UI.uncapture(.)
Section titled “UI.uncapture(.)”UI.uncapture(control : Control) : NoneUncapture a control and have inputs be distributed regularly.
UI.bring_to_front(.)
Section titled “UI.bring_to_front(.)”UI.bring_to_front(control : Control) : NoneBring the control to the front in its current context (globally in the
UIor within its parent if its a child)
UI.control_at_point(…)
Section titled “UI.control_at_point(…)”UI.control_at_point(entity : Entity, x : Num, y : Num) : ControlGet the highest control at a position.
UI.controls_at_point(…)
Section titled “UI.controls_at_point(…)”UI.controls_at_point(entity : Entity, x : Num, y : Num) : ListGet all controls at a position.
UI.mouse_to_canvas(…)
Section titled “UI.mouse_to_canvas(…)”UI.mouse_to_canvas(entity : Entity, x : Num, y : Num) : Float2Translate from mouse position on screen to canvas coordinates. Uses the set canvas camera.
UI.canvas_to_world(…)
Section titled “UI.canvas_to_world(…)”UI.canvas_to_world(entity : Entity, x : Num, y : Num) : Float3Translate from canvas position to world space.
UI.dump(.)
Section titled “UI.dump(.)”UI.dump(ui : Entity) : NoneWrite a bunch of information about the
UIand its controls into the console.
UI.spawn(…)
Section titled “UI.spawn(…)”UI.spawn(asset_id : String, parent : Control, instance_id : String) : NoneSpawn controls from a ui asset. Puts newly spawned controls into a parent control.
UI.make(…)
Section titled “UI.make(…)”UI.make(ui : Entity, asset : String, instance_id : String) : ControlSpawn controls from a ui asset. Creates new root for newly spawned controls and returns that root control.
UI.draw_depth_of(..)
Section titled “UI.draw_depth_of(..)”UI.draw_depth_of(control : Control, index : Num) : Noneno docs found
UI.draw_text(…)
Section titled “UI.draw_text(…)”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) : Noneno docs found
UI.draw_text(…)
Section titled “UI.draw_text(…)”UI.draw_text(control : Control, x : Num, y : Num, z : Num, string : String, size : Num, font : String, color : Color, align : TextAlign, align_vertical : TextAlign) : Noneno docs found
UI.draw_image(…)
Section titled “UI.draw_image(…)”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) : Noneno docs found
UI.draw_image(…)
Section titled “UI.draw_image(…)”UI.draw_image(control : Control, x : Num, y : Num, z : Num, w : Num, h : Num, angle : Num, color : Color, uv : Vec, image : Image) : Noneno docs found
UI.draw_quad(…)
Section titled “UI.draw_quad(…)”UI.draw_quad(control : Control, x : Num, y : Num, z : Num, w : Num, h : Num, angle : Num, color : Color) : Noneno docs found
UI.draw_circle(…)
Section titled “UI.draw_circle(…)”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) : Noneno docs found
UI.draw_line(…)
Section titled “UI.draw_line(…)”UI.draw_line(control : Control, x1 : Num, y1 : Num, x2 : Num, y2 : Num, z : Num, style : PathStyle) : Noneno docs found
UI.draw_rect(…)
Section titled “UI.draw_rect(…)”UI.draw_rect(control : Control, x : Num, y : Num, z : Num, w : Num, h : Num, angle : Num, style : PathStyle) : Noneno docs found
UI.draw_rect_detailed(…)
Section titled “UI.draw_rect_detailed(…)”UI.draw_rect_detailed(control : Control, x : Num, y : Num, z : Num, w : Num, h : Num, angle : Num, radius : Num, smoothness : Num, style : PathStyle) : Noneno docs found
UI.draw_quad_detailed(…)
Section titled “UI.draw_quad_detailed(…)”UI.draw_quad_detailed(control : Control, x : Num, y : Num, z : Num, w : Num, h : Num, angle : Num, radius : Num, smoothness : Num, color : Color) : Noneno docs found
UI.draw_ring(…)
Section titled “UI.draw_ring(…)”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) : Noneno docs found
UI.draw_path(…)
Section titled “UI.draw_path(…)”UI.draw_path(control : Control, points : List, style : PathStyle, closed : Bool) : Noneno docs found
UI.events_emit(..)
Section titled “UI.events_emit(..)”UI.events_emit(control : Control, type : UIEvent) : Noneno docs found
UI.events_emit(…)
Section titled “UI.events_emit(…)”UI.events_emit(control : Control, type : UIEvent, data : Any) : Noneno docs found
UI.events_emit(…)
Section titled “UI.events_emit(…)”UI.events_emit(control : Control, type : UIEvent, data : Any, data_before : Any) : Noneno docs found
UIBehave
Section titled “UIBehave”import "luxe: world" for UIBehaveno docs found
UIBehave.left
Section titled “UIBehave.left”UIBehave.left : unknownItem anchors to the item to its left or left side of parent
UIBehave.top
Section titled “UIBehave.top”UIBehave.top : unknownItem anchors to the item above it or top side of parent
UIBehave.right
Section titled “UIBehave.right”UIBehave.right : unknownItem anchors to the item to its right or right side of parent
UIBehave.bottom
Section titled “UIBehave.bottom”UIBehave.bottom : unknownItem anchors to the item below it or bottom side of parent
UIBehave.hfill
Section titled “UIBehave.hfill”UIBehave.hfill : unknownItem anchors to both left and right item or parent borders
UIBehave.vfill
Section titled “UIBehave.vfill”UIBehave.vfill : unknownItem anchors to both top and bottom item or parent borders
UIBehave.hcenter
Section titled “UIBehave.hcenter”UIBehave.hcenter : unknownCenter item horizontally, with left margin as offset
UIBehave.vcenter
Section titled “UIBehave.vcenter”UIBehave.vcenter : unknownCenter item vertically, with top margin as offset
UIBehave.center
Section titled “UIBehave.center”UIBehave.center : unknownCenter item in both directions, with left/top margin as offset
UIBehave.fill
Section titled “UIBehave.fill”UIBehave.fill : unknownAnchor item to all four directions
UIBehave.break_line
Section titled “UIBehave.break_line”UIBehave.break_line : unknownno docs found
UIClear
Section titled “UIClear”import "luxe: world" for UIClearUsed as an argument when a UI container is cleared to specify what happens to the affected controls.
destroyis often easiest, but only turning controls invisible or removing them from their parent and undoing that as you need them again may be more performant.
UIClear.destroy
Section titled “UIClear.destroy”UIClear.destroy : unknownDestroy the controls (like
Control.destroy(_)).
UIClear.remove
Section titled “UIClear.remove”UIClear.remove : unknownRemove the controls from their parent control (like
Control.child_remove(_, _)).
UIClear.set_invisible
Section titled “UIClear.set_invisible”UIClear.set_invisible : unknownTurn controls invisible (like
Control.set_visible(_, false)).
UIClear.remove_set_invisible
Section titled “UIClear.remove_set_invisible”UIClear.remove_set_invisible : unknownBoth removes control from parent and sets them as not visible.
UIContain
Section titled “UIContain”import "luxe: world" for UIContainno docs found
UIContain.row
Section titled “UIContain.row”UIContain.row : unknownItems go from left to right
UIContain.column
Section titled “UIContain.column”UIContain.column : unknownItems go from top to bottom
UIContain.layout
Section titled “UIContain.layout”UIContain.layout : unknownUse Free Layout model
UIContain.flex
Section titled “UIContain.flex”UIContain.flex : unknownUse Flex Layout model
UIContain.nowrap
Section titled “UIContain.nowrap”UIContain.nowrap : unknownStays on a single line
UIContain.wrap
Section titled “UIContain.wrap”UIContain.wrap : unknownWraps to multiple lines, wrapping left to right
UIContain.start
Section titled “UIContain.start”UIContain.start : unknownItems begin at start of row/column
UIContain.middle
Section titled “UIContain.middle”UIContain.middle : unknownItems begin at middle of row/column
UIContain.end
Section titled “UIContain.end”UIContain.end : unknownItems begin at end of row/column
UIContain.justify
Section titled “UIContain.justify”UIContain.justify : unknownInsert spacing between items to stretch elements across whole row/column
UIContain.vfit
Section titled “UIContain.vfit”UIContain.vfit : unknownItems stretch height to fill vertical space
UIContain.hfit
Section titled “UIContain.hfit”UIContain.hfit : unknownItems stretch width to fill horizontal space
UIDebugMode
Section titled “UIDebugMode”import "luxe: world" for UIDebugModeno docs found
UIDebugMode.none
Section titled “UIDebugMode.none”UIDebugMode.none : unknownno docs found
UIDebugMode.basic
Section titled “UIDebugMode.basic”UIDebugMode.basic : unknownno docs found
UIDrop
Section titled “UIDrop”import "luxe: world" for UIDropno docs found
UIDrop.start
Section titled “UIDrop.start”UIDrop.start : unknownno docs found
UIDrop.end
Section titled “UIDrop.end”UIDrop.end : unknownno docs found
UIDrop.move
Section titled “UIDrop.move”UIDrop.move : unknownno docs found
UIDrop.drop
Section titled “UIDrop.drop”UIDrop.drop : unknownno docs found
UIEvent
Section titled “UIEvent”import "luxe: world" for UIEventThe built in UI events that all controls can potentially use.
UIEvent.name(.)
Section titled “UIEvent.name(.)”UIEvent.name(value : Any) : unknownConverts a UIEvent value to a readable name.
Log.print(UIEvent.name(UIEvent.move)) //prints "move"
UIEvent.unknown
Section titled “UIEvent.unknown”UIEvent.unknown : unknownAn event of unknown type, invalid. This is the default value.
UIEvent.enter
Section titled “UIEvent.enter”UIEvent.enter : unknownAn 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
Section titled “UIEvent.exit”UIEvent.exit : unknownAn 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
Section titled “UIEvent.press”UIEvent.press : unknownAn input press event (e.g mouse button was pressed down). a.k.a “down” Sends
event.x,event.yandevent.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
Section titled “UIEvent.release”UIEvent.release : unknownAn input release event (e.g mouse button was released). a.k.a “up” Sends
event.x,event.yandevent.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
Section titled “UIEvent.scroll”UIEvent.scroll : unknownA scroll event (e.g mouse wheel). Sends
event.x,event.ywherexis the horizontal scroll amount, andyis the vertical scroll amount.if(event.type == UIEvent.scroll) {Log.print("scroll amount `%(event.x)`,`%(event.y)`")}
UIEvent.move
Section titled “UIEvent.move”UIEvent.move : unknownAn input move event (e.g mouse movement). Sends
event.x,event.yas the position of the input.if(event.type == UIEvent.press) {Log.print("move on control at `%(event.x)`,`%(event.y)`")}
UIEvent.key
Section titled “UIEvent.key”UIEvent.key : unknownA 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- aBoolvalue, whether the key is down or not
event.repeat- aBoolvalue, 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!")}}
UIEvent.text
Section titled “UIEvent.text”UIEvent.text : unknownA 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.textis 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 (editorinput)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.editevents, with a start and end. When a candidate is selected (or no choices), aTextEvent.inputis sent with thetext.
UIEvent.focus
Section titled “UIEvent.focus”UIEvent.focus : unknownA control has gained focus. Sends no additional data in the event.
if(event.type == UIEvent.focus) {Log.print("gained focus!")}
UIEvent.unfocus
Section titled “UIEvent.unfocus”UIEvent.unfocus : unknownA control has lost focus. Sends no additional data in the event.
if(event.type == UIEvent.unfocus) {Log.print("lost focus!")}
UIEvent.capture
Section titled “UIEvent.capture”UIEvent.capture : unknownA control has been captured.
if(event.type == UIEvent.capture) {Log.print("gained input capture!")}
UIEvent.uncapture
Section titled “UIEvent.uncapture”UIEvent.uncapture : unknownA control has lost capture status.
if(event.type == UIEvent.uncapture) {Log.print("lost input capture!")}
UIEvent.commit
Section titled “UIEvent.commit”UIEvent.commit : unknownWhen a control has changeable state (like an editable text control), it will send a
commitevent 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
Section titled “UIEvent.destroy”UIEvent.destroy : unknownWhen 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
Section titled “UIEvent.language”UIEvent.language : unknownWhen 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
Section titled “UIEvent.change”UIEvent.change : unknownChange 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.changecontains the relevant data.//UIText exampleif(event.type == UIEvent.change) {Log.print("text changed `%(event.change)`!")}
UIEvent.bounds
Section titled “UIEvent.bounds”UIEvent.bounds : unknownA control has changed bounds (note: this may not be working as intended right now). Sends
event.dx,event.dyandevent.dw,event.dhwheredmeansdelta. 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
Section titled “UIEvent.drag”UIEvent.drag : unknownWhen 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
Section titled “UIImageFit”import "luxe: world" for UIImageFitno docs found
UIImageFit.fill
Section titled “UIImageFit.fill”UIImageFit.fill : unknownno docs found
UIImageFit.contain
Section titled “UIImageFit.contain”UIImageFit.contain : unknownno docs found
UIImageFit.cover
Section titled “UIImageFit.cover”UIImageFit.cover : unknownno docs found
UIImageFit.keep_width
Section titled “UIImageFit.keep_width”UIImageFit.keep_width : unknownno docs found
UIImageFit.keep_height
Section titled “UIImageFit.keep_height”UIImageFit.keep_height : unknownno docs found
UIImageFlags
Section titled “UIImageFlags”import "luxe: world" for UIImageFlagsno docs found
UIImageFlags.none
Section titled “UIImageFlags.none”UIImageFlags.none : unknownuses linear interpolation samplers, interpolating smoothly between pixels.
UIImageFlags.pixelated
Section titled “UIImageFlags.pixelated”UIImageFlags.pixelated : unknownuses nearest neighbor samplers, leading to an interpolated look.
UIImageFlags.use_mips
Section titled “UIImageFlags.use_mips”UIImageFlags.use_mips : unknownuses trilinear interpolation samplers, interpolating smoothly between pixels and mip levels.
UILayoutMode
Section titled “UILayoutMode”import "luxe: world" for UILayoutModeno docs found
UILayoutMode.none
Section titled “UILayoutMode.none”UILayoutMode.none : unknownno docs found
UILayoutMode.flex
Section titled “UILayoutMode.flex”UILayoutMode.flex : unknownno docs found
UIRenderMode
Section titled “UIRenderMode”import "luxe: world" for UIRenderModeno docs found
UIRenderMode.unknown
Section titled “UIRenderMode.unknown”UIRenderMode.unknown : unknownno docs found
UIRenderMode.image
Section titled “UIRenderMode.image”UIRenderMode.image : unknownno docs found
UIRenderMode.world
Section titled “UIRenderMode.world”UIRenderMode.world : unknownno docs found
WorldEventType
Section titled “WorldEventType”import "luxe: world" for WorldEventTypeno docs found
WorldEventType.unknown
Section titled “WorldEventType.unknown”WorldEventType.unknown : unknownno docs found
WorldEventType.create
Section titled “WorldEventType.create”WorldEventType.create : unknownno docs found
WorldEventType.destroy
Section titled “WorldEventType.destroy”WorldEventType.destroy : unknownno docs found
WorldEventType.tick
Section titled “WorldEventType.tick”WorldEventType.tick : unknownno docs found
WorldEventType.modifier_tick
Section titled “WorldEventType.modifier_tick”WorldEventType.modifier_tick : unknownno docs found
WorldEventType.name(.)
Section titled “WorldEventType.name(.)”WorldEventType.name(value : WorldEventType) : Stringno docs found
WorldRenderDesc
Section titled “WorldRenderDesc”import "luxe: world" for WorldRenderDescno docs found
WorldRenderDesc.camera
Section titled “WorldRenderDesc.camera”WorldRenderDesc.camera : unknownno docs found
WorldRenderDesc.camera
Section titled “WorldRenderDesc.camera”WorldRenderDesc.camera=(v : Any) : unknownno docs found
WorldRenderDesc.camera(.)
Section titled “WorldRenderDesc.camera(.)”WorldRenderDesc.camera(v : Any) : unknownno docs found
WorldRenderDesc.cull_camera
Section titled “WorldRenderDesc.cull_camera”WorldRenderDesc.cull_camera : unknownno docs found
WorldRenderDesc.cull_camera
Section titled “WorldRenderDesc.cull_camera”WorldRenderDesc.cull_camera=(v : Any) : unknownno docs found
WorldRenderDesc.cull_camera(.)
Section titled “WorldRenderDesc.cull_camera(.)”WorldRenderDesc.cull_camera(v : Any) : unknownno docs found
WorldRenderDesc.no_cull
Section titled “WorldRenderDesc.no_cull”WorldRenderDesc.no_cull : unknownno docs found
WorldRenderDesc.no_cull
Section titled “WorldRenderDesc.no_cull”WorldRenderDesc.no_cull=(v : Any) : unknownno docs found
WorldRenderDesc.no_cull(.)
Section titled “WorldRenderDesc.no_cull(.)”WorldRenderDesc.no_cull(v : Any) : unknownno docs found
WorldRenderDesc.new(.)
Section titled “WorldRenderDesc.new(.)”WorldRenderDesc.new() : WorldRenderDescno docs found