UiContext

eu.joaocosta.interim.UiContext$
See theUiContext companion class
object UiContext

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
UiContext.type

Members list

Type members

Classlikes

final case class ItemStatus(hot: Boolean, active: Boolean, selected: Boolean)

Status of an item.

Status of an item.

Value parameters

active

if the mouse clicked the item (and is still pressed down). This value stays true for one extra frame, so that it's possible to trigger an action on mouse up.

hot

if the mouse is on top of the item

selected

if this was the last element clicked

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def registerItem(id: ItemId, area: Rect, passive: Boolean)(using uiContext: UiContext, inputState: InputState): ItemStatus

Registers an item on the UI state, taking a certain area.

Registers an item on the UI state, taking a certain area.

Components register themselves on every frame to update and check their status.

Note that this is only required when creating new components.

Value parameters

area

the area of this component

id

Item ID to register

passive

passive items are items such as windows that are never marked as active, they are just registered to block components under them.

Attributes

Returns

the item status of the registered component.

def withZIndex[T](zIndex: Int)(body: UiContext ?=> T)(using uiContext: UiContext): T

Applies the operations in a code block at a specified z-index (higher z-indices show on front of lower z-indices).

Applies the operations in a code block at a specified z-index (higher z-indices show on front of lower z-indices).

Attributes