CompositeTexture

A composite texture splits a larger area onto smaller chunks, making rendering large pieces of text more efficient.

Constructors

this
this(Vector2 size, Vector2 dpi, bool alwaysMax)
Undocumented in source.
this
deprecated this(Vector2 size, bool alwaysMax)
Undocumented in source.

Members

Functions

allChunks
allChunks()

Get a range of indices for all chunks.

chunkCount
size_t chunkCount()
Undocumented in source. Be warned that the author may not have intended to support it.
chunkPosition
Vector2 chunkPosition(size_t i)

Get position of the given chunk in dots.

chunkRectangle
Rectangle chunkRectangle(size_t i, Vector2 offset)

Get the rectangle of the given chunk in dots.

chunkSize
Vector2 chunkSize(size_t i)

Get the expected size of the chunk at given index

chunkViewportPosition
Vector2 chunkViewportPosition(size_t i)

Get position of the given chunk in pixels.

chunkViewportRectangle
Rectangle chunkViewportRectangle(size_t i, Vector2 offset)

Get the rectangle of the given chunk in dots.

chunkViewportSize
Vector2 chunkViewportSize(size_t i)
Undocumented in source. Be warned that the author may not have intended to support it.
clearImage
void clearImage(size_t i)

Clear the image of the given chunk, making it transparent.

column
size_t column(size_t i)
Undocumented in source. Be warned that the author may not have intended to support it.
columns
size_t columns()
Undocumented in source. Be warned that the author may not have intended to support it.
drawAlign
void drawAlign(FluidBackend backend, Rectangle rectangle, Color tint)

Draw onscreen parts of the texture.

drawAlign
void drawAlign(CanvasIO canvasIO, Rectangle rectangle, Color tint)

Draw onscreen parts of the texture using the new backend.

index
size_t index(size_t x, size_t y)

Get index of the chunk at given X or Y.

resize
void resize(Vector2 size, Vector2 dpi, bool alwaysMax)

Set a new size for the texture; recalculate the chunk number

resize
deprecated void resize(Vector2 size, bool alwaysMax)
Undocumented in source. Be warned that the author may not have intended to support it.
row
size_t row(size_t i)
Undocumented in source. Be warned that the author may not have intended to support it.
rows
size_t rows()
Undocumented in source. Be warned that the author may not have intended to support it.
upload
void upload(FluidBackend backend, size_t i, Vector2 dpi)

Update the texture of a given chunk using its corresponding image.

upload
void upload(CanvasIO canvasIO, size_t index, Vector2 dpi)

Update the texture of a given chunk using its corresponding image.

viewportSize
Vector2 viewportSize()
Undocumented in source. Be warned that the author may not have intended to support it.
visibleChunks
visibleChunks(Vector2 position, Vector2 windowSize)

Get a range of indices for all currently visible chunks. Accepts position in pixels.

Manifest constants

maxChunkSize
enum maxChunkSize;
Undocumented in source.

Structs

Chunk
struct Chunk
Undocumented in source.

Variables

chunks
Chunk[] chunks;

Underlying textures.

dpi
Vector2 dpi;

DPI of the texture.

format
Image.Format format;

Format of the texture.

palette
Color[] palette;

Palette to use for the texture, if relevant.

size
Vector2 size;

Total size of the texture.

Meta