Expand description

A prelude for users of the crate. Imports all the most commonly used types and functions.

Modules

  • Element is a React-inspired virtual tree library for the Ambient runtime.

Structs

Enums

Constants

Traits

Functions

  • Align horizontal begin: Layout alignment: horizontal begin.
  • Align horizontal center: Layout alignment: horizontal center.
  • Align horizontal end: Layout alignment: horizontal end.
  • Align vertical begin: Layout alignment: vertical begin.
  • Align vertical center: Layout alignment: vertical center.
  • Align vertical end: Layout alignment: vertical end.
  • The color used for the background of the app.
  • Background color: Background color of an entity with a rect component.
  • Border color: Border color of an entity with a rect component.
  • Border radius: Radius for each corner of an entity with a rect component.
  • Border thickness: Border thickness of an entity with a rect component.
  • Cast shadows: If attached, this entity will cast shadows.
  • Helper for constructing a Cb.
  • Children: The children of this entity.
  • Color: This entity will be tinted with the specified color if the color is not black.
  • Cursor position: Absolute mouse cursor position in screen-space. This is the logical position. Multiply by the window_scale_factor to get the physical position.
  • A color slightly darker than app_background_color.
  • Cylindrical billboard Z: If attached, this ensures this entity is always aligned with the camera, except on the Z-axis.
  • Decal material from URL: Load a Decal material from the URL and attach it to this entity.
  • Description: A human-friendly description for this entity.
  • Docking bottom: Layout docking: bottom.
  • Docking fill: Layout docking: fill.
  • Docking left: Layout docking: left.
  • Docking right: Layout docking: right.
  • Docking top: Layout docking: top.
  • Don’t automatically despawn on module unload: Indicates that this entity shouldn’t be despawned when the module that spawned it unloads.
  • Don’t store: Indicates that this entity shouldn’t be stored on disk.
  • Double-sided: If this is set, the entity will be rendered with double-sided rendering.
  • Delta Time: How long the previous tick took in seconds.
  • Element: The identifier of the Element that controls this entity.
  • Element unmanaged children: If this is set, the user is expected to manage the children of the Element themselves.
  • The error color.
  • Euler rotation: The Euler rotation of this entity in ZYX order.
  • Fit horizontal children: Layout fit: horizontal children.
  • Fit horizontal none: Layout fit: horizontal none.
  • Fit horizontal parent: Layout fit: horizontal parent.
  • Fit vertical children: Layout fit: vertical children.
  • Fit vertical none: Layout fit: vertical none.
  • Fit vertical parent: Layout fit: vertical parent.
  • Fog color: The color of the fog for this sun.
  • Fog density: The density of the fog for this sun.
  • Fog height fall-off: The height at which the fog will fall off (i.e. stop being visible) for this sun.
  • Font family: Font family to be used. Can either be ‘Default’, ‘FontAwesome’, ‘FontAwesomeSolid’, ‘Code’ or a url to a font.
  • Font size: Size of the font.
  • Font style: One of Bold, BoldItalic, Medium, MediumItalic, Regular, Italic, Light or LightItalic.
  • GPU UI size: Upload the width and height of this UI element to the GPU.
  • Height: The height of a UI element.
  • ID: The ID of the entity.
  • Inverse Local to World: Converts a world position to a local position.
  • Is book file: This is a file in a layout_bookcase.
  • Joint Matrices: Contains the matrices for each joint of this skinned mesh.
  • Joints: Contains the joints that comprise this skinned mesh.
  • Bookcase layout: Min-max bookcase layout.
  • Dock layout: Top-down dock layout.
  • Flow layout: Bottom-up flow layout.
  • Layout width to children: Width to children.
  • Light ambient: The ambient light color of the sun.
  • Light diffuse: The diffuse light color of the sun.
  • Line from: Start point of a line.
  • Line to: End point of a line.
  • Line width: Width of line.
  • Local to Parent: Transformation from the entity’s local space to the parent’s space.
  • Local to World: Transformation from the entity’s local space to worldspace.
  • Local user ID: The user ID of the local player.
  • Look-at target: The position that this entity should be looking at.
  • Look-at up: When combined with lookat_target, the up vector for this entity.
  • Main scene: If attached, this entity belongs to the main scene.
  • Map seed: A random number seed for this map.
  • Margin: Layout margin: [top, right, bottom, left].
  • Maximum height: The maximum height of a UI element.
  • Maximum width: The maximum width of a UI element.
  • Mesh to Local: Transformation from mesh-space to the entity’s local space.
  • Mesh to local from size: Update the mesh_to_local based on the width and height of this entity.
  • Mesh to World: Transformation from mesh-space to world space.
  • Minimum height: The minimum height of a UI element.
  • Minimum width: The minimum width of a UI element.
  • Mouse over: The number of mouse cursors that are currently over this entity.
  • Mouse pickable max: This entity can be clicked by the mouse, and this component defines the max AABB bound of the click area.
  • Mouse pickable min: This entity can be clicked by the mouse, and this component defines the min AABB bound of the click area.
  • Name: A human-friendly name for this entity.
  • Orientation horizontal: Layout orientation: horizontal.
  • Orientation vertical: Layout orientation: vertical.
  • Outline: If attached, this entity will be rendered with an outline with the color specified.
  • Outline (recursive): If attached, this entity and all of its children will be rendered with an outline with the color specified.
  • Overlay: If attached, this entity will be rendered with an overlay.
  • Padding: Layout padding: [top, right, bottom, left].
  • Parent: The parent of this entity.
  • PBR material from URL: Load a PBR material from the URL and attach it to this entity.
  • Player: This entity is a player.
  • The primary color.
  • Project Name: The name of the project, from the manifest.
  • Rect: If attached to an entity, the entity will be converted to a UI rectangle, with optionally rounded corners and borders.
  • Reset scale: If attached to a transform hierarchy, the scale will be reset at that point, with only rotation/translation considered.
  • Rotation: The rotation of this entity.
  • Scale: The scale of this entity.
  • Screen: This entity will be treated as a screen. Used by the Screen ui component.
  • The secondary color.
  • Selectable: If attached, this object can be selected in the editor.
  • Sky: Add a realistic skybox to the scene.
  • Snap to ground: This object should automatically be moved with the terrain if the terrain is changed.
  • Space between items: Space between items in a layout.
  • Spherical billboard: If attached, this ensures that this entity is always aligned with the camera.
  • Sun: Marks this entity as a sun (i.e. its rotation will be used to control the global light direction).
  • Tags: Tags for categorizing this entity.
  • Text: Create a text mesh on this entity.
  • The color used for tooltip backgrounds.
  • Translation: The translation/position of this entity.
  • Transparency group: Controls when this transparent object will be rendered. Transparent objects are sorted by (transparency_group, z-depth).
  • UI scene: If attached, this entity belongs to the UI scene.
  • A hook that returns the current focus state for this element and a callback to set the focus state.
  • A hook that returns the current window logical resolution (i.e. taking DPI scaling into account)
  • A hook that returns the current window physical resolution (i.e. not taking DPI scaling into account)
  • User ID: An identifier attached to all things owned by a user, and supplied by the user.
  • Water: Add a realistic water plane to this entity.
  • Width: The width of a UI element.
  • Window logical size: The logical size is the physical size divided by the scale factor.
  • Window physical size: The physical size is the actual number of pixels on the screen.
  • Window scale factor: The DPI/pixel scale factor of the window.
  • Converts the given element into a rect.

Type Definitions

Attribute Macros

  • Helper macro to implement a ElementComponent with a pure free function.