Surface

bearlyb.surface.Surface
See theSurface companion object
class Surface

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def addAlternateImage(image: Surface): Unit

Adds an alternative version of this surface, typically used for high dpi representations of cursors or icons. This call adds a reference to the image so you should call image.destroy() after this method returns.

Adds an alternative version of this surface, typically used for high dpi representations of cursors or icons. This call adds a reference to the image so you should call image.destroy() after this method returns.

Value parameters

image

alternative version of this surface, does not need to be the same format, size, or have the same content as this surface.

Attributes

def apply(pos: Pos): RawColor
def blit(src: Surface, at: Pos, mask: Rect[Int] | Null): Unit

'Blit' a surface onto this one. Blitting is like taking a picture and putting it on top of another one.

'Blit' a surface onto this one. Blitting is like taking a picture and putting it on top of another one.

Attributes

def blitScaled(src: Surface, dstmask: Rect[Int] | Null, srcmask: Rect[Int] | Null)(using scaleMode: ScaleMode): Unit
def blitTiled(src: Surface, dstmask: Rect[Int] | Null, srcmask: Rect[Int] | Null): Unit
def blitTiledWithScale[T : Numeric](src: Surface, scale: T, dstmask: Rect[Int] | Null, srcmask: Rect[Int] | Null)(using evidence$1: Numeric[T], scaleMode: ScaleMode): Unit
def clear(r: Float, g: Float, b: Float, a: Float): Unit
def destroy(): Unit
def fillRect(rect: Rect[Int], color: RawColor): Unit
def fillRect(x: Int, y: Int, w: Int, h: Int, color: RawColor): Unit
def fillRect(rect: Rect[Int], color: Color): Unit
def fillRect(x: Int, y: Int, w: Int, h: Int, color: Color): Unit
def flip(mode: FlipMode): Unit
def getImages(): Iterator[Surface]
def hasAlternateImages: Boolean
def height: Int
def lock(): Unit
def mapRGB(color: Init[Color]): RawColor

Converts a color to the raw value, depending on the surface's format.

Converts a color to the raw value, depending on the surface's format.

Type parameters

T

the type used to represent each channel of the color, if it is an integer type, then the value must be between 0 and 255, and if it is a floating-point type (or is fractional), then the value must be in the range 0..=1

Value parameters

color

the color to be converted

Attributes

Returns

the raw color value

def mapRGBA(color: Color): RawColor
def mustLock: Boolean
def removeAlternateImages(): Unit
def saveBMP(file: String): Unit
def scaled[T](by: T)(using num: Numeric[T], scaleMode: ScaleMode): Surface
def scaled(width: Int, height: Int)(using scaleMode: ScaleMode): Surface
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
def unlock(): Unit
def unmapRGB(raw: RawColor): Init[Color]
def unmapRGBA(raw: RawColor): Color
def update(pos: Pos, color: RawColor): Unit
def update(pos: Pos, color: Color): Unit
def update(x: Int, y: Int, color: Color): Unit
def width: Int