TextureAtlasReader

ceramic._TextureAtlasParser.TextureAtlasReader (private class)

Internal line-based reader for parsing LibGDX format atlas files.

Provides utilities for reading key-value pairs and comma-separated tuples from the text-based atlas format. Handles cross-platform line endings and whitespace trimming.

Instance Members

trim(value: String): String

Trims whitespace from a string.

Name Type Description
value String String to trim
Returns Description
String Trimmed string

readLine(): String

Reads the next line from the atlas.

Returns Description
String Next line or null if end of file

nextLineKey(): String

Peeks at the key of the next line without consuming it.

Used to determine what type of data follows in the atlas format. Keys are the part before the colon in "key: value" lines.

Returns Description
String The key string or null if no key found

readValue(): String

Reads a key-value line and returns the value part.

Expects format "key: value" and returns trimmed value.

Returns Description
String The value after the colon

readTuple(tuple: Array<Dynamic>): Int

Reads comma-separated values into a tuple array.

Parses lines like "key: v1, v2, v3, v4" into the provided array. Handles 1, 2, or 4 value tuples as used in atlas format.

Name Type Description
tuple Array<Dynamic> Array to fill with parsed values
Returns Description
Int Number of values read (1, 2, or 4)

new(text: String): Void

Creates a reader for the given atlas text.

Normalizes line endings and splits into array for processing.

Name Type Description
text String The raw atlas file content

Private Members

lines: Array<String>

All lines from the atlas file, normalized.


index: Int

Current line index for sequential reading.

Metadata

Name Parameters
:allow ceramic.TextureAtlasParser