Sprites.Media.Font.Chars
The characters panel: the glyphs of the font, laid out to pick the one to edit. The Window is titled Characters, open with the editor, and holds the glyphs flowing left to right and wrapping at the panel width, scrolling down as the set overflows. Each character is drawn double size on a white ground with a two pixel green border, and the selected one takes a dark green border, so the pick reads without a button. A click on a character selects it. It stands where the sprite editor's Layers and Frames panels stand.
- Sprites.Media.Font.Chars.Border
- Sprites.Media.Font.Chars.Cell
- Sprites.Media.Font.Chars.Grid
- Sprites.Media.Font.Chars.Scale
- Sprites.Media.Font.Chars.SelectedBorder
- Sprites.Media.Font.Chars.Window
Sprites.Media.Font.Chars.Border String
The border colour of an unselected character cell: the theme green, matching a button.
'var(--accent)'
Sprites.Media.Font.Chars.Cell Void
Sprites.Media.Font.Chars.Cell(thumb, index, selectedChar, charIndex, cssWidth, cssHeight, code)
One character cell: a bordered box holding the glyph as a PNG drawn double size on a white ground, no button. A click selects the character by writing its index to selectedChar; the cell takes the selected class while it is the current one and the plain class otherwise, chosen with Select over an Equals, so exactly one cell reads as selected and the border colour is CSS. It is a plain HTML box at a whole-pixel size, so it holds its place and its size as the window moves.
| Input | Type | Description |
|---|---|---|
thumb | Value | The glyph's PNG data URL. |
index | Number | The character's position in the font. |
selectedChar | Value | The two way selection a click writes. |
charIndex | Number | The clamped current selection, for the highlight. |
cssWidth | String | The double-size cell width as a CSS length. |
cssHeight | String | The double-size cell height as a CSS length. |
code | String | The character's code point, shown as a hover title. |
Returns nothing.
Sprites.Media.Font.Chars.Grid Void
Sprites.Media.Font.Chars.Grid(chars, selectedChar, charIndex, first, width, height, optionalSlots, aspect)
The character grid: a padded container holding a wrapping Flow, an Each over the characters in code order, each cell a double-size PNG glyph. The cells flow and wrap at the container width, so the grid fills the window's width and reflows as it is resized. Its padding is on the inside, so when it sits in a flush scrolling area the glyphs stay inset while the scrollbar meets the window edge. The cell size is the glyph size times the scale, as CSS lengths shared by every cell; the hover title is the first code point plus the cell's position; the thumbnail is a PNG drawn through the palette and pixel aspect. A composite over Sprites.Maths and Sprites.Text, built with Each over the reactive characters list.
| Input | Type | Description |
|---|---|---|
chars | Value | The two way characters list. |
selectedChar | Value | The two way selection a click writes. |
charIndex | Number | The clamped current selection, for the highlight. |
first | Number | The first code point, for the hover titles. |
width | Number | The glyph cell width. |
height | Number | The glyph cell height. |
optionalSlots | Array | The slot colours for an indexed font, or absent for freeform. |
aspect | Number | The pixel aspect the glyphs draw at. |
Returns nothing.
Sprites.Media.Font.Chars.Scale Number
Each glyph pixel is drawn this many screen pixels wide, so a character shows double size.
2
Sprites.Media.Font.Chars.SelectedBorder String
The border colour of the selected character cell: the darker theme green, so the current character reads without a button.
'var(--accent-hover)'
Sprites.Media.Font.Chars.Window Void
Sprites.Media.Font.Chars.Window(visible, chars, selectedChar, charIndex, first, width, height, optionalSlots, aspect)
The Characters panel window: a floating, resizeable panel, shown while visible is true, with a close button, and open by default. It holds a vertical scrolling area placed straight in the window body, outside a content area, so the area sits flush against the window edges and its scrollbar meets the window edge; the grid inside carries the padding. The characters flow and wrap at the window's width, so dragging the window wider fits more a row, and the area scrolls down as they overflow. The Tools window's Windows buttons reopen it. A font's character set is fixed, so the grid picks a character and adds or removes none; it stands where the sprite editor's Layers and Frames panels stand.
| Input | Type | Description |
|---|---|---|
visible | Value | The panel's show flag. |
chars | Value | The two way characters list. |
selectedChar | Value | The two way selection a click writes. |
charIndex | Number | The clamped current selection, for the highlight. |
first | Number | The first code point, for the hover titles. |
width | Number | The glyph cell width. |
height | Number | The glyph cell height. |
optionalSlots | Array | The slot colours for an indexed font, or absent for freeform. |
aspect | Number | The pixel aspect the glyphs draw at. |
Returns nothing.