CPScreen

org.cosplay.CPScreen
final class CPScreen(dim: CPDim, bgPixel: CPPixel) extends CPZPixelPane

Game engine view on terminal screen.

Value parameters

bgPixel

Background pixel for the screen.

dim

Screen dimension.

Attributes

Source
CPScreen.scala
Graph
Supertypes
trait CPZPixelPane
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def addPixel(zpx: CPZPixel, x: Int, y: Int): Unit

Adds Z-pixel at given XY-coordinate.

Adds Z-pixel at given XY-coordinate.

Value parameters

x

X-coordinate of the pixel.

y

Y-coordinate of the pixel.

zpx

Z-pixel to add.

Attributes

Definition Classes
Source
CPScreen.scala
def apply(x: Int, y: Int): Option[CPZPixel]

Gets the pixel at given XY-coordinate.

Gets the pixel at given XY-coordinate.

Value parameters

x

X-coordinate of the pixel to get.

y

Y-coordinate of the pixel to get.

Attributes

Source
CPScreen.scala
def clear(): Unit

Clears this screen.

Clears this screen.

Attributes

Source
CPScreen.scala
def copy(): CPScreen

Creates a new screen that is a copy of this screen.

Creates a new screen that is a copy of this screen.

Attributes

Source
CPScreen.scala
def copyTo(other: CPScreen, target: CPRect): Unit

Copies region of this screen to another screen.

Copies region of this screen to another screen.

Value parameters

other

Other screen to copy to.

Attributes

Source
CPScreen.scala
override def equals(obj: Any): Boolean

Compares the receiver object (this) with the argument object (that) for equivalence.

Compares the receiver object (this) with the argument object (that) for equivalence.

Any implementation of this method should be an equivalence relation:

  • It is reflexive: for any instance x of type Any, x.equals(x) should return true.
  • It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any instances x, y, and z of type Any if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is usually necessary to override hashCode to ensure that objects which are "equal" (o1.equals(o2) returns true) hash to the same scala.Int. (o1.hashCode.equals(o2.hashCode)).

Value parameters

that

the object to compare against this object for equality.

Attributes

Returns

true if the receiver object is equivalent to the argument; false otherwise.

Definition Classes
Any
Source
CPScreen.scala
override def getBgPixel: CPPixel

Gets background pixel of this pane.

Gets background pixel of this pane.

Attributes

Definition Classes
Source
CPScreen.scala
override def getDim: CPDim

Gets dimension of this pane.

Gets dimension of this pane.

Attributes

Definition Classes
Source
CPScreen.scala
override def getPixel(x: Int, y: Int): CPZPixel

Gets Z-pixel at given XY-coordinate.

Gets Z-pixel at given XY-coordinate.

Value parameters

x

X-coordinate of the pixel.

y

Y-coordinate of the pixel.

Attributes

Definition Classes
Source
CPScreen.scala

Gets rectangular shape of this screen.

Gets rectangular shape of this screen.

Attributes

Source
CPScreen.scala

Creates new canvas that can be used to draw on this screen.

Creates new canvas that can be used to draw on this screen.

Attributes

Source
CPScreen.scala
def newCanvas(clip: CPRect): CPCanvas

Creates new canvas that can be used to draw on this screen with given clipping region.

Creates new canvas that can be used to draw on this screen with given clipping region.

Value parameters

clip

Clipping region.

Attributes

Source
CPScreen.scala
override def optPixel(x: Int, y: Int): Option[CPZPixel]

Gets optional Z-pixel at given XY-coordinate.

Gets optional Z-pixel at given XY-coordinate.

Value parameters

x

X-coordinate of the pixel.

y

Y-coordinate of the pixel.

Attributes

Returns

Some of pixel if given XY-coordinate is valid, None otherwise.

Definition Classes
Source
CPScreen.scala

Inherited methods

def addPixel(px: CPPixel, x: Int, y: Int, z: Int): Unit

Adds pixel at given XY-coordinate and Z-index.

Adds pixel at given XY-coordinate and Z-index.

Value parameters

px

Pixel to add.

x

X-coordinate of the pixel.

y

Y-coordinate of the pixel.

z

Z-index. Pixel with the larger or equal Z-index overrides the pixel with the smaller one.

Attributes

Inherited from:
CPZPixelPane
Source
CPZPixelPane.scala