Crate amethyst_ui[][src]

Provides components and systems to create an in game user interface.

Structs

Anchored

Component indicating that the position of this entity should be relative to the parent's position.

DrawUi

Draw Ui elements. UI won't display without this. It's recommended this be your last pass.

FontAsset

A loaded set of fonts from a file.

MouseReactive

A component that tags an entity as reactive to ui events. Will only work if the entity has a UiTransform component attached to it. Without this, the ui element will not generate events.

ResizeSystem

This system rearranges UI elements whenever the screen is resized using their UiResize component.

Stretched

Component indicating that an entity should be stretched to fit the parent size on one or multiple axes.

TextEditing

If this component is attached to an entity with a UiText then that UiText is editable. This component also controls how that editing works.

TtfFormat

Loads font files, supports TrueType and some OpenType files.

UiBundle

UI bundle

UiButton

A clickable button.

UiButtonBuilder

Builder for a UiButton.

UiButtonResources

Container that wraps the resources we need to initialize button defaults

UiEvent

A ui event instance.

UiFocused

This resource stores the currently focused UI element.

UiImage

A component with the texture to display in this entity's UiTransform

UiLayoutSystem

Used to initialize the UiTransform and Anchored offsets when using the Anchored component.

UiMouseSystem

The system that generates events for MouseReactive enabled entities. The generic types A and B represent the A and B generic parameter of the InputHandler<A,B>.

UiParentSystem

Manages the Parent component on entities having UiTransform It does almost the same as the TransformSystem, but with some differences, like UiTransform alignment and stretching.

UiResize

Whenever the window is resized the function in this component will be called on this entity's UiTransform, along with the new width and height of the window.

UiSystem

This system processes the underlying UI data as needed.

UiText

A component used to display text in this entity's UiTransform

UiTransform

The UiTransform represents the transformation of a ui element. Values are in pixel and the position is calculated from the top left of the screen to the center of the ui element's area.

Enums

Anchor

Indicated where the anchor is, relative to the parent (or to the screen, if there is no parent). Follow a normal english Y,X naming.

ScaleMode

Unused, will be implemented in a future PR. Indicated if the position and margins should be calculated in pixel or relative to their parent size.

Stretch

Indicates if a component should be stretched.

UiEventType

The type of ui event. Click happens if you start and stop clicking on the same ui element.

Type Definitions

FontHandle

A handle to font data stored with amethyst_assets.

OtfFormat

Identical to TtfFormat.