CanvasIOOps

Representation of a canvas operation, with the common Monad operations.

class Object
trait Matchable
class Any
object CanvasIO.type

Value members

Concrete methods

def accessCanvas[A](f: Canvas => A): CanvasIO[A]

Store an unsafe canvas operation in a CanvasIO.

Store an unsafe canvas operation in a CanvasIO.

def changeSettings(newSettings: Settings): CanvasIO[Unit]

Changes the settings applied to the canvas.

Changes the settings applied to the canvas.

Value parameters:
newSettings

new canvas settings

def clear(buffers: Set[Buffer]): CanvasIO[Unit]

Clears buffers, such as the backbuffer and keyboard inputs.

Clears buffers, such as the backbuffer and keyboard inputs.

Value parameters:
buffers

set of Canvas.Buffers to be cleared

Deprecated methods

@deprecated("Use CanvasIO.getPixel instead")
def getBackbufferPixel(x: Int, y: Int): CanvasIO[Color]

Gets the color from the backbuffer. This operation can be perfomance intensive, so it might be worthwile to either use getBackbuffer to fetch multiple pixels at the same time or to implement this operation on the application code.

Gets the color from the backbuffer. This operation can be perfomance intensive, so it might be worthwile to either use getBackbuffer to fetch multiple pixels at the same time or to implement this operation on the application code.

Value parameters:
x

pixel x position

y

pixel y position

Deprecated

Inherited methods

def accessMSurface[A](f: MutableSurface => A): MSurfaceIO[A]

Wrap mutable surface operations in a MSurfaceIO.

Wrap mutable surface operations in a MSurfaceIO.

Inherited from:
MSurfaceIOOps
def accessSurface[A](f: Surface => A): SurfaceIO[A]

Wrap surface operations in a SurfaceIO.

Wrap surface operations in a SurfaceIO.

Inherited from:
SurfaceIOOps
def blit(that: Surface)(x: Int, y: Int, cx: Int, cy: Int, cw: Int, ch: Int): MSurfaceIO[Unit]

Draws a surface on top of this surface.

Draws a surface on top of this surface.

Value parameters:
ch

clip height of the source surface

cw

clip width of the source surface

cx

leftmost pixel on the source surface

cy

topmost pixel on the source surface

that

surface to draw

x

leftmost pixel on the destination surface

y

topmost pixel on the destination surface

Inherited from:
MSurfaceIOOps
def blitWithMask(that: Surface, mask: Color)(x: Int, y: Int, cx: Int, cy: Int, cw: Int, ch: Int): MSurfaceIO[Unit]

Draws a surface on top of this surface and masks the pixels with a certain color.

Draws a surface on top of this surface and masks the pixels with a certain color.

Value parameters:
ch

clip height of the source surface

cw

clip width of the source surface

cx

leftmost pixel on the source surface

cy

topmost pixel on the source surface

mask

color to usa as a mask

that

surface to draw

x

leftmost pixel on the destination surface

y

topmost pixel on the destination surface

Inherited from:
MSurfaceIOOps
def fill(color: Color): MSurfaceIO[Unit]

Fill the surface with a certain color

Fill the surface with a certain color

Value parameters:
color

Color to fill the surface with

Inherited from:
MSurfaceIOOps
def getPixel(x: Int, y: Int): SurfaceIO[Option[Color]]

Gets the color from the this surface. This operation can be perfomance intensive, so it might be worthwile to either use getPixels to fetch multiple pixels at the same time or to implement this operation on the application code.

Gets the color from the this surface. This operation can be perfomance intensive, so it might be worthwile to either use getPixels to fetch multiple pixels at the same time or to implement this operation on the application code.

Value parameters:
x

pixel x position

y

pixel y position

Inherited from:
SurfaceIOOps
def putPixel(x: Int, y: Int, color: Color): MSurfaceIO[Unit]

Put a pixel in the surface with a certain color.

Put a pixel in the surface with a certain color.

Value parameters:
color

Color to apply to the pixel

x

pixel x position

y

pixel y position

Inherited from:
MSurfaceIOOps

Concrete fields

val getKeyboardInput: CanvasIO[KeyboardInput]

Gets the current keyboard input.

Gets the current keyboard input.

val getPointerInput: CanvasIO[PointerInput]

Gets the current pointer input.

Gets the current pointer input.

val getSettings: CanvasIO[Settings]

Fetches the canvas settings.

Fetches the canvas settings.

val redraw: CanvasIO[Unit]

Flips buffers and redraws the screen.

Flips buffers and redraws the screen.

Deprecated fields

@deprecated("Use CanvasIO.getPixels instead")
val getBackbuffer: CanvasIO[Vector[Vector[Color]]]

Returns the backbuffer. This operation can be perfomance intensive, so it might be worthwile to implement this operation on the application code.

Returns the backbuffer. This operation can be perfomance intensive, so it might be worthwile to implement this operation on the application code.

Deprecated

Inherited fields

val getPixels: SurfaceIO[Vector[Array[Color]]]

Returns the pixels from this surface. This operation can be perfomance intensive, so it might be worthwile to implement this operation on the application code.

Returns the pixels from this surface. This operation can be perfomance intensive, so it might be worthwile to implement this operation on the application code.

Returns:

color matrix

Inherited from:
SurfaceIOOps