Graphics

Description

sealed class Tinman.Engine.Drawing.Graphics

Derived from

Disposable abstract
IBeginEnd
ILineThickness

The Graphics class provides methods for performing pixel-perfect 2D drawing.

Pixel coordinates always refer to the center of a pixel, e.g. the pixel coordinates (0|0) refer to the center of the top-left pixel in the viewport. The center of the lower-right pixel is at (ScreenWidth-1|ScreenHeight-1). Names of method parameters that take pixel coordinates have the 'pixel' prefix (e.g. 'pixelX').

Screen coordinates refer to the whole viewport: the screen coordinates (0|0) refer to the top-left corner of the top-left pixel in the viewport. The lower-right corner of the lower-right pixel is at (ScreenWidth|ScreenHeight). Names of method parameters that take screen coordinates have the 'screen' prefix (e.g. 'screenX').

The Flush method may be called to make sure that all buffered work gets submitted. When this method has returned, all used resources may be disposed, without any impact on 2D rendering.

The Draw* methods allow passing of null resources (e.g. Bitmap, ITexture2D, PixelFont). In this case, these methods draw nothing and return silently.

Public / Constants

Alpha


public constant Alpha → (3:int32)

Source data from alpha channel of texture.

Blue


public constant Blue → (2:int32)

Source data from blue color channel.

Green


public constant Green → (1:int32)

Source data from green color channel.

Luminance


public constant Luminance → (6:int32)

Source data from average luminance of red, green and blue channels.

One


public constant One → (5:int32)

Source data as always one.

Red


public constant Red → (0:int32)

Source data from red color channel.

Zero


public constant Zero → (4:int32)

Source data as always zero.

Public / Constructors

Graphics


public constructor Graphics → (1)

context in : IGraphicsContext

[not-null]
The graphics context to use.

Creates a new instance of Graphics.

The recommended way to obtain an instance of this class is by querying the shared graphics object of the graphics context (see IGraphicsContext.Graphics).

RenderException

If a graphics subsystem error has occurred.

Public / Methods

Clear


[BeginEnd]
public method Clear → (1)

color in : int64

The color to clear to.

Clears the current clip rectangle to the given color.

ColorChannels


public method ColorChannels → (4)

red opt : int32 = Graphics.Red

The source for the output red channel.

green opt : int32 = Graphics.Green

The source for the output green channel.

blue opt : int32 = Graphics.Blue

The source for the output blue channel.

alpha opt : int32 = Graphics.Alpha

The source for the output alpha channel.

Specifies the color channel sources for 2D rendering.

The following sources may be specified:
Red, Green, Blue, Alpha, Zero, One.

Color channel values are sourced from the texture samples. When rendering without textures, an opaque white texture sample is used instead. Modulation colors that have been passed to render methods will be applied after the color sources are applied.

ComputeAnchorX

2 overloads


[Pure]
public static method ComputeAnchorX1 → (3)

anchor in : Anchor

The anchor type.

pixelRight in : int32

Pixel coordinate of right edge.

pixelLeft opt : int32 = 0

Pixel coordinate of left edge.

returns → int32

The anchor pixel X-coordinate.

Computes the position for the given anchor.


[Pure]
public static method ComputeAnchorX2 → (3)

anchor in : Anchor

The anchor type.

pixelRight in : float32

Pixel coordinate of right edge.

pixelLeft opt : float32 = 0

Pixel coordinate of left edge.

returns → float32

The anchor pixel X-coordinate.

Computes the position for the given anchor.

ComputeAnchorY

2 overloads


[Pure]
public static method ComputeAnchorY1 → (4)

anchor in : Anchor

The anchor type.

pixelBottom in : int32

Pixel coordinate of bottom edge.

pixelTop opt : int32 = 0

Pixel coordinate of top edge.

pixelBaseline opt : int32 = 0

Pixel coordinate of baseline.

returns → int32

The anchor pixel Y-coordinate.

Computes the position for the given anchor.


[Pure]
public static method ComputeAnchorY2 → (4)

anchor in : Anchor

The anchor type.

pixelBottom in : float32

Pixel coordinate of bottom edge.

pixelTop opt : float32 = 0

Pixel coordinate of top edge.

pixelBaseline opt : float32 = 0

Pixel coordinate of baseline.

returns → float32

The anchor pixel Y-coordinate.

Computes the position for the given anchor.

CreateBitmap


[OwnerReturn]
public method CreateBitmap → (3)

width in : int32

[>0]
The image width, in pixels.

height in : int32

[>0]
The image height, in pixels.

flags opt : BitmapFlags = BitmapFlags.Default

The image flags.

returns → Bitmap

The created image resource.

Creates a new image resource.

RenderException

If a graphics subsystem error has occurred.

CreatePrimitiveBuffer


[OwnerReturn]
public method CreatePrimitiveBuffer → (1)

capacity in : int32

[>0]
The buffer capacity, in vertices.

returns → IVertexBuffer

The vertex buffer for 2D primitives (see remarks).

Creates a vertex buffer that can be used to draw batched 2D primitives.

The returned buffer has the following layout:

  1. Byte offset #0: Screen X-coordinate (32-bit floating point).

  2. Byte offset #4: Screen Y-coordinate (32-bit floating point).

  3. Byte offset #8: Depth coordinate (32-bit floating point).

  4. Byte offset #12: Color value (32-bit integer, A8R8G8B8).

  5. Byte offset #16: Texture U-coordinate (32-bit floating point).

  6. Byte offset #20: Texture V-coordinate (32-bit floating point).

RenderException

If a graphics subsystem error has occurred.

DrawBitmap

2 overloads


[BeginEnd]
public method DrawBitmap1 → (4)

bitmap in : Bitmap

The image to draw.

pixel in : Vec2I

Pixel coordinates of image anchor.

anchor opt : Anchor = Anchor.TopLeft

The image anchor to use.

color opt : int64 = Colors.White

Image pixels will be modulated by this color (see Colors) value.

Draws a bitmap image onto the screen.

See also

Graphics.Offset


[BeginEnd]
public method DrawBitmap2 → (5)

bitmap in : Bitmap

The image to draw.

pixelX in : int32

Pixel X-coordinate of image anchor.

pixelY in : int32

Pixel Y-coordinate of image anchor.

anchor opt : Anchor = Anchor.TopLeft

The image anchor to use.

color opt : int64 = Colors.White

Image pixels will be modulated by this color (see Colors) value.

Draws a bitmap image onto the screen.

See also

Graphics.Offset

DrawBitmapOutline


[BeginEnd]
public method DrawBitmapOutline → (5)

bitmap in : Bitmap

The image to draw.

pixelX in : int32

Pixel X-coordinate of image anchor.

pixelY in : int32

Pixel Y-coordinate of image anchor.

anchor opt : Anchor = Anchor.TopLeft

The image anchor to use.

color opt : int64 = Colors.Black

Image pixels will be modulated by this color (see Colors) value.

Draws a bitmap image onto the screen.

See also

Graphics.Offset

DrawBitmapPart

2 overloads


[BeginEnd]
public method DrawBitmapPart1 → (5)

bitmap in : Bitmap

The image to draw.

part in : Box2I

The bitmap part to draw.

pixel in : Vec2I

Pixel coordinates of image anchor.

anchor opt : Anchor = Anchor.TopLeft

The image anchor to use.

color opt : int64 = Colors.White

Image pixels will be modulated by this color (see Colors) value.

Draws a bitmap image onto the screen.

See also

Graphics.Offset


[BeginEnd]
public method DrawBitmapPart2 → (9)

bitmap in : Bitmap

The image to draw.

partX in : int32

[0..bitmap.Width]
X-coordinate of top-left bitmap pixel to draw.

partY in : int32

[0..bitmap.Height]
Y-coordinate of top-left bitmap pixel to draw.

partWidth in : int32

[0..bitmap.Width-partX]
Width of bitmap part to draw, in pixels.

partHeight in : int32

[0..bitmap.Height-partY]
Height of bitmap part to draw, in pixels.

pixelX in : int32

Pixel X-coordinate of image anchor.

pixelY in : int32

Pixel Y-coordinate of image anchor.

anchor opt : Anchor = Anchor.TopLeft

The image anchor to use.

color opt : int64 = Colors.White

Image pixels will be modulated by this color (see Colors) value.

Draws a bitmap image onto the screen.

See also

Graphics.Offset

DrawBitmapStretch


[BeginEnd]
public method DrawBitmapStretch → (7)

bitmap in : Bitmap

The image to draw.

pixelX in : int32

Pixel X-coordinate of image anchor.

pixelY in : int32

Pixel Y-coordinate of image anchor.

width in : int32

[>0]
Width of image on screen.

height in : int32

[>0]
Height of image on screen.

anchor opt : Anchor = Anchor.TopLeft

The image anchor to use.

color opt : int64 = Colors.White

Image pixels will be modulated by this color (see Colors) value.

Draws a bitmap image onto the screen.

See also

Graphics.Offset

DrawBitmapTransform


[BeginEnd]
public method DrawBitmapTransform → (6)

bitmap in : Bitmap

The image to draw.

transform in : Mat3F

The transformation matrix to apply (see remarks).

pixelX in : int32

Pixel X-coordinate of image anchor.

pixelY in : int32

Pixel Y-coordinate of image anchor.

anchor opt : Anchor = Anchor.TopLeft

The image anchor to use.

color opt : int64 = Colors.White

Image pixels will be modulated by this color (see Colors) value.

Draws a bitmap image onto the screen.

First the untransformed bitmap bounds are computed from the given image anchor. Then the given transformation matrix is applied to the corner vertices of the bitmap bounds. Finally, a textured quad is rendered using the transformed corner vertices.

DrawChar


[BeginEnd]
public method DrawChar → (6)

font in : PixelFont

The font to use.

in : char

The character to draw.

pixelX in : int32

Pixel X-coordinate of anchor point.

pixelY in : int32

Pixel Y-coordinate of anchor point.

color in : int64

The color to use (see Colors).

anchor opt : Anchor = Anchor.TopLeft

The anchor to use.

Draws a character glyph onto the 2D canvas.

See also

PixelFont

DrawCircle


[BeginEnd]
public method DrawCircle → (5)

pixelX in : float32

Pixel X-coordinate of circle center.

pixelY in : float32

Pixel Y-coordinate of circle center.

radius in : float32

Radius of circle, in pixel units.

colorBorder in : int64

Color (see Colors) of circle border or 0 for no border.

colorFill opt : int64 = 0

Color (see Colors) of circle fill of 0 for no fill.

Draws a circle.

DrawLine


[BeginEnd]
public method DrawLine → (5)

pixelX1 in : float32

Pixel X-coordinate of first point.

pixelY1 in : float32

Pixel Y-coordinate of first point.

pixelX2 in : float32

Pixel X-coordinate of second point.

pixelY2 in : float32

Pixel Y-coordinate of second point.

color in : int64

The color (see Colors) to use.

Draws a line segment, filling both endpoints.

DrawLineHorizontal


[BeginEnd]
public method DrawLineHorizontal → (4)

pixelX in : int32

Pixel X-coordinate of first line endpoint.

pixelY in : int32

Pixel Y-coordinate of line.

length in : int32

Length of the line.

color in : int64

The color (see Colors) value to use.

Draws a horizontal line.

See also

Graphics.Offset

DrawLineVertical


[BeginEnd]
public method DrawLineVertical → (4)

pixelX in : int32

Pixel X-coordinate of line.

pixelY in : int32

Pixel Y-coordinate of first line endpoint.

length in : int32

Length of the line.

color in : int64

The color (see Colors) value to use.

Draws a vertical line.

See also

Graphics.Offset

DrawPolygon

3 overloads


[BeginEnd]
public method DrawPolygon1 → (4)

color in : int64

Modulation color for the polygon vertex colors.

vertices in : Vertex [ ]

[not-null]
The polygon vertices.

first opt : int32 = 0

[0..vertices.Length]
Index of first polygon vertex.

count opt : int32 = -1

[-1..vertices.Length-first]
Number of polygon vertices. If -1 all remaining vertices are used.

Draws a simple polygon.


[BeginEnd]
public method DrawPolygon2 → (4)

texture in : Bitmap

The texture image to use.

vertices in : Vertex [ ]

[not-null]
The polygon vertices.

first opt : int32 = 0

[0..vertices.Length]
Index of first polygon vertex.

count opt : int32 = -1

[-1..vertices.Length-first]
Number of polygon vertices. If -1 all remaining vertices are used.

Draws a simple polygon.


[BeginEnd]
public method DrawPolygon3 → (4)

texture in : ITexture2D

The texture image to use.

vertices in : Vertex [ ]

[not-null]
The polygon vertices.

first opt : int32 = 0

[0..vertices.Length]
Index of first polygon vertex.

count opt : int32 = -1

[-1..vertices.Length-first]
Number of polygon vertices. If -1 all remaining vertices are used.

Draws a simple polygon.

DrawPolyline


[BeginEnd]
public method DrawPolyline → (5)

closed in : bool

Connect the last vertex with the first vertex (i.e. draw a closed polyline)?

color in : int64

Modulation color for the polyline vertex colors.

vertices in : Vertex [ ]

[not-null]
The polyline vertices.

first opt : int32 = 0

[0..vertices.Length]
Index of first polyline vertex.

count opt : int32 = -1

[-1..vertices.Length-first]
Number of polyline vertices. If -1 all remaining vertices are used.

Draws a polyline.

DrawPrimitive


[BeginEnd]
public method DrawPrimitive → (3)

primitive in : Primitive

The primitive to draw.

first in : int32

[>=0]
First vertex to draw (see remarks).

count in : int32

[>=0]
Number of vertices to draw (see remarks).

Draws a batched 2D primitive.

If an index buffer has been specified to DrawPrimitivePrepare, the given first in and count in parameters refer to elements in the index buffer. Otherwise, they refer to vertices in the 2D vertex buffer.

DrawPrimitiveBegin


[BeginEnd]
public method DrawPrimitiveBegin → (3)

primitive in : Primitive

The primitive to render.

texture opt : ITexture2D = null

The texture image to use.

slice opt : int32 = 0

The texture slice to use.

Begins to render a 2D primitive which vertices are specified via the Vertex(…​) method.

DrawPrimitiveEnd


[BeginEnd]
public method DrawPrimitiveEnd → ()

Finishes rendering of the current 2D primitive.

DrawPrimitivePrepare


[BeginEnd]
public method DrawPrimitivePrepare → (2)

geometryBuffer in : IGeometryBuffer

[not-null]
The geometry buffer (see CreatePrimitiveBuffer).

texture opt : ITexture2D = null

Optional texture to use.

Prepares to render batched 2D primitives.

DrawPrimitiveVertex

4 overloads


[BeginEnd]
public method DrawPrimitiveVertex1 → (1)

in : Vertex

The vertex.

Specifies the next vertex for the current 2D primitive.


[BeginEnd]
public method DrawPrimitiveVertex2 → (2)

in : Vertex

The vertex.

color in : int64

The color to multiply with Vertex.Color.

Specifies the next vertex for the current 2D primitive.


[BeginEnd]
public method DrawPrimitiveVertex3 → (3)

screenX in : float32

Screen X-coordinate of vertex.

screenY in : float32

Screen Y-coordinate of vertex.

color in : int64

The diffuse vertex color (see Colors).

Specifies the next vertex for the current 2D primitive.


[BeginEnd]
public method DrawPrimitiveVertex4 → (5)

in : float32

X-coordinate of vertex, in screen-space.

in : float32

Y-coordinate of vertex, in screen-space.

color in : int64

The diffuse vertex color (see Colors).

in : float32

Texture U-coordinate.

in : float32

Texture V-coordinate.

Specifies the next vertex for the current 2D primitive.

DrawRectangle

2 overloads


[BeginEnd]
public method DrawRectangle1 → (3)

bounds in : Box2I

The rectangle bounds, in pixel coordinates.

colorBorder in : int64

The border color (see Colors) to use or 0 for no border.

colorFill opt : int64 = 0

The fill color (see Colors) to use or 0 for no fill.

Draws a rectangle.

See also

Graphics.Offset


[BeginEnd]
public method DrawRectangle2 → (6)

pixelX in : int32

Pixel X-coordinate of top-left corner of rectangle.

pixelY in : int32

Pixel Y-coordinate of top-left corner of rectangle.

width in : int32

Width of rectangle, in pixels.

height in : int32

Height of rectangle, in pixels.

colorBorder in : int64

The border color (see Colors) to use or 0 for no border.

colorFill opt : int64 = 0

The fill color (see Colors) to use or 0 for no fill.

Draws a rectangle.

See also

Graphics.Offset

DrawRoundRectangle

2 overloads


[BeginEnd]
public method DrawRoundRectangle1 → (5)

bounds in : Box2I

The rectangle bounds, in pixel coordinates.

round in : int32

Radius of round corners, in pixel units.

colorBorder in : int64

The border color (see Colors) to use or 0 for no border.

colorFill opt : int64 = 0

The fill color (see Colors) to use or 0 for no fill.

corners opt : Corner = Corner.All

The round rectangle corners.

Draws a rectangle with round corners.

See also

Graphics.Offset


[BeginEnd]
public method DrawRoundRectangle2 → (8)

pixelX in : int32

Pixel X-coordinate of top-left corner of rectangle.

pixelY in : int32

Pixel Y-coordinate of top-left corner of rectangle.

width in : int32

Width of rectangle, in pixels.

height in : int32

Height of rectangle, in pixels.

round in : int32

Radius of round corners, in pixel units.

colorBorder in : int64

The border color (see Colors) to use or 0 for no border.

colorFill opt : int64 = 0

The fill color (see Colors) to use or 0 for no fill.

corners opt : Corner = Corner.All

The round rectangle corners.

Draws a rectangle with round corners.

DrawShape

2 overloads


[BeginEnd]
public method DrawShape1 → (3)

shape in : IShape

[not-null]
The vector shape.

colorBorder in : int64

The color to use for drawing the shape triangles.

colorFill opt : int64 = 0

The color to use for drawing the shape edges.

Draws the given vector shape (see IShape.EdgeAt).

If shape in is a IShapeGroup, the contained shapes will be drawn separately.


[BeginEnd]
public method DrawShape2 → (4)

shape in : IShape

[not-null]
The vector shape.

transform in : Mat3D

The transformation matrix from shape coordinates to screen coordinates.

colorBorder in : int64

The color to use for drawing the shape triangles.

colorFill opt : int64 = 0

The color to use for drawing the shape edges.

Draws the given vector shape.

If shape in is a IShapeGroup, the contained shapes will be drawn separately.

DrawString


[BeginEnd]
public method DrawString → (6)

font in : PixelFont

The font to use.

text in : string

[not-null]
The text to draw.

pixelX in : int32

Pixel X-coordinate of anchor point.

pixelY in : int32

Pixel Y-coordinate of anchor point.

color in : int64

The color (see Colors) to use.

anchor opt : Anchor = Anchor.TopLeft

The anchor to use.

Draws a pixel-perfect string onto the 2D canvas.

DrawStringOutline


[BeginEnd]
public method DrawStringOutline → (7)

font in : PixelFont

The font to use.

text in : string

[not-null]
The text to draw.

pixelX in : int32

Pixel X-coordinate of anchor point.

pixelY in : int32

Pixel Y-coordinate of anchor point.

textColor in : int64

The text color (see Colors) to use.

anchor opt : Anchor = Anchor.TopLeft

The anchor to use.

outlineColor opt : int64 = Colors.Black & Colors.Opaque50

The outline color (see Colors) to use.

Draws a pixel-perfect string onto the 2D canvas.

FindAnchor


[Pure]
public static method FindAnchor → (2)

direction in : Vec2D

Direction vector pointing towards a rectangle.

baseline opt : bool = true

true uses Anchor.Base as the rectangle bottom edge, false uses Anchor.Bottom.

returns → Anchor

The best anchor.

Finds the best anchor on a rectangle for the given screen direction.

FlipAnchor


[Pure]
public static method FlipAnchor → (1)

anchor in : Anchor

The anchor to flip.

returns → Anchor

The flipped anchor.

Flips the given anchor.

Flush


public method Flush → ()

Flushes buffered render commands to the GPU.

Usually it is not necessary to call this method, because a flush automatically happens when IBeginEnd.End is called.

Fullscreen


public method Fullscreen → ()

returns → Graphics

this

Sets the Bounds of this Graphics object to full-screen (i.e. the size of the current render target, see IGraphicsContext.Size).

LoadBitmapFrom

2 overloads


[OwnerReturn]
public method LoadBitmapFrom1 → (2)

file in : Path

[not-null]
The file path.

flags opt : BitmapFlags = BitmapFlags.Default

The image flags to apply when loading the image file.

returns → Bitmap

The loaded image resource.

Loads an image resource from the given file.

This method will always perform sRGB decompression on file in.

IOException

If an I/O error has occurred.

ValidatingException

If the image reader has reported an error, for example because of an unsupported file format feature.

RenderException

If a graphics subsystem error has occurred.


[OwnerReturn]
public method LoadBitmapFrom2 → (2)

image in : IImage

[not-null]
The image descriptor.

flags opt : BitmapFlags = BitmapFlags.Default

The image flags to apply when loading the image file.

returns → Bitmap

The loaded image resource.

Loads an image resource from the given image descriptor.

IOException

If an I/O error has occurred.

ValidatingException

If the image reader has reported an error, for example because of an unsupported file format feature.

RenderException

If a graphics subsystem error has occurred.

LoadFontFrom


[OwnerReturn]
public method LoadFontFrom → (1)

file in : Path

[not-null]
The file path.

returns → PixelFont

The loaded font resource.

Loads a pixel font resource from the given image file.

IOException

If an I/O error has occurred.

ValidatingException

If the given image is not a valid pixel font, see PixelFontBuilder.

RenderException

If a graphics subsystem error has occurred.

See also

PixelFontBuilder

PopClip


[BeginEnd]
public method PopClip → ()

Restores the most recent clip rectangle from the clip stack.

PopDepth


[BeginEnd]
public method PopDepth → ()

Restores the previous depth value.

PushClip

2 overloads


[BeginEnd]
public method PushClip1 → (1)

bounds in : Box2I

The bounds of the clip rectangle, in pixel coordinates.

returns → bool

true if the clip rectangle contains at least one screen pixel, false if it is empty.

Pushes the current clip rectangle onto the stack, intersects it with the given rectangle and sets the clip rectangle to the result.

See also

Graphics.PopClip


[BeginEnd]
public method PushClip2 → (4)

pixelX in : int32

Pixel X-coordinate of top-left corner of clip rectangle.

pixelY in : int32

Pixel Y-coordinate of top-left corner of clip rectangle.

width in : int32

Width of clip rectangle, in pixels.

height in : int32

Height of clip rectangle, in pixels.

returns → bool

true if the clip rectangle contains at least one screen pixel, false if it is empty.

Pushes the current clip rectangle onto the clip stack and intersects it with the given rectangle.

PushDepth


[BeginEnd]
public method PushDepth → (1)

depth in : float32

The depth value, in the range [0..1].

Uses the given depth value for all subsequent 2D primitives.

TestClip


public method TestClip → (4)

pixelX in : int32

Pixel X-coordinate of top-left corner of clip rectangle.

pixelY in : int32

Pixel Y-coordinate of top-left corner of clip rectangle.

width in : int32

[>=0]
Width of clip rectangle, in pixels.

height in : int32

[>=0]
Height of clip rectangle, in pixels.

returns → bool

true if the intersection of the rectangles contains at least one screen pixel, false if it is empty.

Tests if the current clip rectangle intersects with the given clip rectangle.

Translate

2 overloads


[BeginEnd]
public method Translate1 → (1)

pixel in : Vec2I

Translation amount, in pixels.

Translates all 2D rendering by the given amount.


[BeginEnd]
public method Translate2 → (2)

pixelX in : int32

Horizontal translation amount, in pixels.

pixelY in : int32

Vertical translation amount, in pixels.

Translates all 2D rendering by the given amount.

Write


public static method Write → (3)

vertex in : Vertex

The vertex to write.

buffer in : ByteBuffer

[not-null]
The target buffer.

depth opt : float32 = 0

The screen depth value (see PushDepth).

Writes the given vertex to the specified buffer.

Public / Attributes

Bounds


public attribute Bounds → (get,set)

value : Box2I

The bounds, in pixel coordinates.

The bounds of this graphics object on the render target(s) of the graphics context.

Cache


public attribute Cache → (get)

value : ResourceCache

[not-null]
The shared resource cache.

The shared resource cache of this Graphics instance.

Resources that have been obtained via IResourceCache.GetNull will be disposed when this Graphics object is disposed.

Clip


public attribute Clip → (get)

value : Box2I

The clip rectangle, in screen pixel coordinates.

Returns the current clip rectangle.

Context


public attribute Context → (get)

value : IGraphicsContext

[not-null]
The graphics context.

Returns the graphics context.

DefaultFont


public attribute DefaultFont → (get)

value : PixelFont

[not-null]
The simple font.

Returns a PixelFont object that has been created from ColorBuffer.DrawChar.

Loader


public attribute Loader → (get)

value : ResourceLoader

[not-null]
The shared resource loader.

The shared resource loader of this Graphics instance.

Offset


public attribute Offset → (get,set)

value : Vec2F

The sub-pixel offsets.

Specifies the sub-pixel offset for subsequent rendering.

Only the fractional parts of the components of the given vector are used, the integral is set to zero.

Draw methods that take integer coordinates make use of the sub-pixel offset. Namely, these are:

Please note that draw methods that use pixel fonts do not apply the sub-pixels offset.

ScreenHeight


public attribute ScreenHeight → (get)

value : int32

[>0]
The screen height, in pixels.

Returns the screen height.

ScreenSize


public attribute ScreenSize → (get)

value : Vec2I

The screen size, in pixels.

Returns the screen size.

ScreenWidth


public attribute ScreenWidth → (get)

value : int32

[>0]
The screen width, in pixels.

Returns the screen width.

Translation


public attribute Translation → (get)

value : Vec2I

The current translation.

Returns the current translation amounts.