InterIm

eu.joaocosta.interim.InterIm$

Object with all the DSL operations.

Most applications will only need to import eu.joaocosta.interim._ and eu.joaocosta.interim.InterIm._. However, since some of the methods in the DSL can conflict with other variable names, it can be desirable to not import the DSL and explicitly use the InterIm prefix (e.g. IterIm.text instead of text)

Attributes

Graph
Supertypes
trait Panels
trait Constants
trait Components
trait Layouts
trait Primitives
class Object
trait Matchable
class Any
Show all
Self type
InterIm.type

Members list

Type members

Inherited classlikes

Attributes

Inherited from:
Components
Supertypes
class Object
trait Matchable
class Any

Inherited types

type Component[+T] = (inputState: InputState, uiContext: UiContext) => T

Attributes

Inherited from:
Components

Value members

Concrete methods

def ui[T](inputState: InputState, uiContext: UiContext)(run: (inputState: InputState, uiContext: UiContext) => T): (List[RenderOp], T)

Wraps the UI interactions. All API calls should happen inside the body (run parameter).

Wraps the UI interactions. All API calls should happen inside the body (run parameter).

This method takes an input state and a UI context and mutates the UI context accordingly. This should be called on every frame.

The method returns a list of operations to render and the result of the body.

Attributes

Inherited methods

final def button(id: ItemId, area: Rect, label: String, skin: ButtonSkin): () ?=> Boolean

Button component. Returns true if it's being clicked, false otherwise.

Button component. Returns true if it's being clicked, false otherwise.

Value parameters

label

text label to show on this button

Attributes

Inherited from:
Components
final def checkbox(id: ItemId, area: Rect, skin: CheckboxSkin): ComponentWithValue[Boolean]

Checkbox component. Returns true if it's enabled, false otherwise.

Checkbox component. Returns true if it's enabled, false otherwise.

Attributes

Inherited from:
Components
final def clip[T](area: Rect)(body: (InputState, UiContext) ?=> T)(using inputState: InputState, uiContext: UiContext): T

Clipped region.

Clipped region.

The body will be rendered only inside the clipped area. Input outside the area will also be ignored.

Note that the clip will only be applied to elements in the current Z-index.

Attributes

Inherited from:
Layouts
final def closeHandle[T](id: ItemId, area: Rect, skin: HandleSkin): ComponentWithValue[PanelState[T]]

Close handle. Closes the panel when clicked.

Close handle. Closes the panel when clicked.

Instead of using this component directly, it can be easier to use eu.joaocosta.interim.api.Panels.window with closable = true.

Attributes

Inherited from:
Components
final def columns[T](area: Rect, numColumns: Int, padding: Int)(body: Vector[Rect] => T): T

Lays out the components in a sequence of columns where all elements have the same size, separated by a padding.

Lays out the components in a sequence of columns where all elements have the same size, separated by a padding.

The body receives a column: Vector[Rect], where column(y) is the rect of the x-th column.

Attributes

Inherited from:
Layouts
final def custom[T](area: Rect, color: Color, data: T)(using uiContext: UiContext): Unit

Advanced operation to add a custom primitive to the list of render operations.

Advanced operation to add a custom primitive to the list of render operations.

Supports an arbitrary data value. It's up to the backend to interpret it as it sees fit. If the backend does not know how to interpret it, it can just render a colored rect.

Value parameters

data

custom value to be interpreted by the backend.

Attributes

Inherited from:
Primitives
final def dynamicColumns[T](area: Rect, padding: Int)(body: (Int => Rect) => T): T

Lays out the components in a sequence of columns of different sizes, separated by a padding.

Lays out the components in a sequence of columns of different sizes, separated by a padding.

The body receives a nextColumn: Int => Rect, where nextColumn(width) is the rect of the next column, with the specified width (if possible). . If the size is negative, the row will start from the right.

Attributes

Inherited from:
Layouts
final def dynamicRows[T](area: Rect, padding: Int)(body: (Int => Rect) => T): T

Lays out the components in a sequence of rows of different sizes, separated by a padding.

Lays out the components in a sequence of rows of different sizes, separated by a padding.

The body receives a nextRow: Int => Rect, where nextRow(height) is the rect of the next row, with the specified height (if possible). If the size is negative, the row will start from the bottom.

Attributes

Inherited from:
Layouts
final def grid[T](area: Rect, numRows: Int, numColumns: Int, padding: Int)(body: Vector[Vector[Rect]] => T): T

Lays out the components in a grid where all elements have the same size, separated by a padding.

Lays out the components in a grid where all elements have the same size, separated by a padding.

The body receives a cell: Vector[Vector[Rect]], where cell(y)(x) is the rect of the y-th row and x-th column.

Attributes

Inherited from:
Layouts
final def moveHandle(id: ItemId, area: Rect, skin: HandleSkin): ComponentWithValue[Rect]

Draggable handle. Returns the moved area.

Draggable handle. Returns the moved area.

It's important that this element moves along with the moved area.

Instead of using this component directly, it can be easier to use eu.joaocosta.interim.api.Panels.window with movable = true.

Attributes

Inherited from:
Components
def onBottom[T](body: UiContext ?=> T)(using uiContext: UiContext): T

Applies the operations in a code block at the previous z-index.

Applies the operations in a code block at the previous z-index.

Attributes

Inherited from:
Primitives
def onTop[T](body: UiContext ?=> T)(using uiContext: UiContext): T

Applies the operations in a code block at the next z-index.

Applies the operations in a code block at the next z-index.

Attributes

Inherited from:
Primitives
final def radioButton[T](id: ItemId, area: Rect, buttonValue: T, label: String, skin: ButtonSkin): ComponentWithValue[T]

Radio button component. Returns value currently selected.

Radio button component. Returns value currently selected.

Value parameters

buttonValue

the value of this button (value that this button returns when selected)

label

text label to show on this button

Attributes

Inherited from:
Components
final def rectangle(area: Rect, color: Color)(using uiContext: UiContext): Unit

Draws a rectangle filling a the specified area with a color.

Draws a rectangle filling a the specified area with a color.

Attributes

Inherited from:
Primitives
final def rows[T](area: Rect, numRows: Int, padding: Int)(body: Vector[Rect] => T): T

Lays out the components in a sequence of rows where all elements have the same size, separated by a padding.

Lays out the components in a sequence of rows where all elements have the same size, separated by a padding.

The body receives a row: Vector[Rect], where row(y) is the rect of the y-th row.

Attributes

Inherited from:
Layouts
final def select(id: ItemId, area: Rect, labels: Vector[String], skin: SelectSkin): ComponentWithValue[PanelState[Int]]

Select box component. Returns the index value currently selected inside a PanelState.

Select box component. Returns the index value currently selected inside a PanelState.

Value parameters

labels

text labels for each value

Attributes

Inherited from:
Components
final def slider(id: ItemId, area: Rect, min: Int, max: Int, skin: SliderSkin): ComponentWithValue[Int]

Slider component. Returns the current position of the slider, between min and max.

Slider component. Returns the current position of the slider, between min and max.

Value parameters

max

maximum value fr this slider

min

minimum value for this slider

Attributes

Inherited from:
Components
final def text(area: Rect, color: Color, text: String, font: Font, horizontalAlignment: HorizontalAlignment, verticalAlignment: VerticalAlignment)(using uiContext: UiContext): Unit

Draws a block of text in the specified area with a color.

Draws a block of text in the specified area with a color.

Value parameters

font

font definition

horizontalAlignment

how the text should be aligned horizontally

text

text to write

verticalAlignment

how the text should be aligned vertically

Attributes

Inherited from:
Primitives
final def textInput(id: ItemId, area: Rect, skin: TextInputSkin): ComponentWithValue[String]

Text input component. Returns the current string inputed.

Text input component. Returns the current string inputed.

Attributes

Inherited from:
Components
final def window[T](id: ItemId, area: Rect | PanelState[Rect] | Ref[PanelState[Rect]], title: String, closable: Boolean, movable: Boolean, skin: WindowSkin, handleSkin: HandleSkin)(body: Rect => T): () ?=> (Option[T], PanelState[Rect])

Window with a title.

Window with a title.

Value parameters

closable

if true, the window will include a closable handle in the title bar

movable

if true, the window will include a move handle in the title bar

title

of this window

Attributes

Inherited from:
Panels

Inherited fields

Attributes

Inherited from:
Constants

Attributes

Inherited from:
Constants

Attributes

Inherited from:
Constants

Attributes

Inherited from:
Constants

Attributes

Inherited from:
Constants

Attributes

Inherited from:
Constants
final val maxSize: 2147483647

Attributes

Inherited from:
Constants