CompositeTexture

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

Constructors

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

Members

Functions

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

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.

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, bool alwaysMax)

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

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.

visibleChunks
visibleChunks(Vector2 position, Vector2 windowSize)

Get a range of indices for all currently visible chunks.

Manifest constants

maxChunkSize
enum maxChunkSize;
Undocumented in source.

Structs

Chunk
struct Chunk
Undocumented in source.

Variables

chunks
Chunk[] chunks;

Underlying textures.

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