MutableSurface

trait MutableSurface extends Surface

A surface that can be drawn on using mutable operations.

trait Surface
class Object
trait Matchable
class Any

Value members

Abstract methods

def fill(color: Color): Unit

Fill the surface with a certain color

Fill the surface with a certain color

Value parameters:
color

Color to fill the surface with

def putPixel(x: Int, y: Int, color: Color): 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

Concrete methods

def blit(that: Surface)(x: Int, y: Int, cx: Int, cy: Int, cw: Int, ch: Int): 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

def blitWithMask(that: Surface, mask: Color)(x: Int, y: Int, cx: Int, cy: Int, cw: Int, ch: Int): 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 methods

def getPixel(x: Int, y: Int): 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

Returns:

pixel color

Inherited from:
Surface
def getPixels(): 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:
Surface
def height: Int

The surface height

The surface height

Inherited from:
Surface
def width: Int

The surface width

The surface width

Inherited from:
Surface