InputState

eu.joaocosta.interim.InputState
See theInputState companion trait
object InputState

Attributes

Companion
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
InputState.type

Members list

Type members

Classlikes

final case class Current(mouseInput: MouseInput, keyboardInput: String) extends InputState

Input state at the current point in time

Input state at the current point in time

Value parameters

keyboardInput

String generated from the keyboard inputs since the last frame. Usually this will be a single character. A \u0008 character is interpreted as a backspace.

mouseInput

the current mouse state

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait InputState
class Object
trait Matchable
class Any
Show all
final case class Historical(previousMouseInput: MouseInput, mouseInput: MouseInput, keyboardInput: String) extends InputState

Input state at the current point in time and in the previous frame

Input state at the current point in time and in the previous frame

Value parameters

keyboardInput

String generated from the keyboard inputs since the last frame. Usually this will be a single character. A \u0008 character is interpreted as a backspace.

mouseDown

whether the mouse is pressed

mouseX

mouse X position, from the left

mouseY

mouse Y position, from the top

previousMouseX

previous mouse X position, from the left

previousMouseY

previous mouse Y position, from the top

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait InputState
class Object
trait Matchable
class Any
Show all
final case class MouseInput(position: Option[(Int, Int)], isPressed: Boolean)

Mouse position and button state.

Mouse position and button state.

Value parameters

isPressed

whether the mouse is pressed

position

mouse position in a (x, y) tuple. None if the mouse is off-screen.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object MouseInput

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
MouseInput.type

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def apply(mousePosition: Option[(Int, Int)], mouseDown: Boolean, keyboardInput: String): InputState

Creates a new InputState.

Creates a new InputState.

Value parameters

keyboardInput

String generated from the keyboard inputs since the last frame. Usually this will be a single character. A \u0008 character is interpreted as a backspace.

mousePosition

optional mouse (x, y) position, from the top-left

mousePressed

whether the mouse is pressed

Attributes

def apply(mouseX: Int, mouseY: Int, mouseDown: Boolean, keyboardInput: String): InputState

Creates a new InputState.

Creates a new InputState.

Value parameters

keyboardInput

String generated from the keyboard inputs since the last frame. Usually this will be a single character. A \u0008 character is interpreted as a backspace.

mousePressed

whether the mouse is pressed

mouseX

mouse X position, from the left

mouseY

mouse Y position, from the top

Attributes

def apply(mouseDown: Boolean, keyboardInput: String): InputState

Creates a new InputState with an unknown mouse position.

Creates a new InputState with an unknown mouse position.

Value parameters

keyboardInput

String generated from the keyboard inputs since the last frame. Usually this will be a single character. A \u0008 character is interpreted as a backspace.

mousePressed

whether the mouse is pressed

Attributes