eu.joaocosta.minart.graphics

Type members

Classlikes

trait Canvas extends MutableSurface

Window with a canvas that can be painted.

Window with a canvas that can be painted.

The Canvas is the main concept behind minart, providing access to both rendering and input functionallity.

A canvas represents a window with a width * height pixels. There's also a scale variable that controls the integer scaling and a clearColor that is applied to the whole canvas when it's cleared.

Companion:
object
object Canvas
Companion:
class

Abstraction that provides an init operation to create a new canvas.

Abstraction that provides an init operation to create a new canvas.

This is helpful to deal with the fact that creating a new canvas is a side-effectful operation.

Companion:
object
Companion:
class
final class Color extends AnyVal

RGB Color

RGB Color

Companion:
object
object Color
Companion:
class

A render loop that takes a side-effectful renderFrame operation.

A render loop that takes a side-effectful renderFrame operation.

trait LowLevelCanvas extends Canvas with AutoCloseable

A low-level version of a canvas that provides its own canvas manager.

A low-level version of a canvas that provides its own canvas manager.

Companion:
object
Companion:
class
trait MutableSurface extends Surface

A surface that can be drawn on using mutable operations.

A surface that can be drawn on using mutable operations.

trait Plane extends (Int, Int) => Color
Companion:
object
object Plane
Companion:
class
final class RamSurface(val data: Vector[Array[Color]]) extends MutableSurface

A mutable surface stored in RAM.

A mutable surface stored in RAM.

Value parameters:
data

the raw data that backs this surface

trait RenderLoop[S]

Render loop that keeps an internal state that is passed to every iteration.

Render loop that keeps an internal state that is passed to every iteration.

Type parameters:
S

State

Companion:
object
object RenderLoop
Companion:
class
trait Surface

A Surface is an object that contains a set of pixels.

A Surface is an object that contains a set of pixels.

Canvas backed by a mutable surface.

Canvas backed by a mutable surface.

final case class SurfaceView(plane: Plane, width: Int, height: Int) extends Surface

A view over a surface, stored as a plane limited by a width and height. Allows lazy operations to be applied over a surface.

A view over a surface, stored as a plane limited by a width and height. Allows lazy operations to be applied over a surface.

This can have a performance impact. However, a new RAM surface with the operations already applied can be constructed using toRamSurface

Companion:
object
Companion:
class