Skip to content

Commit 378283e

Browse files
committed
example
1 parent 2d0e9b7 commit 378283e

File tree

1 file changed

+17
-0
lines changed
  • common/src/main/kotlin/com/lambda/graphics/renderer/gui/font

1 file changed

+17
-0
lines changed

common/src/main/kotlin/com/lambda/graphics/renderer/gui/font/LambdaAtlas.kt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,23 @@ import kotlin.time.Duration.Companion.days
5151
* It stores glyph information, manages texture uploads, and provides functionality to build texture buffers for fonts and emoji sets
5252
*
5353
* It caches font information and emoji data for efficient rendering and includes mechanisms for uploading and binding texture atlases
54+
*
55+
* It's also possible to upload custom atlases and bind them with no hassle
56+
* ```kt
57+
* enum class ExampleFont {
58+
* CoolFont("Cool-Font");
59+
* }
60+
*
61+
* fun loadFont(...) = BufferedImage
62+
*
63+
* ExampleFont.CoolFont.uploadAtlas(loadFont(...)) // The extension keeps a reference to the font owner
64+
*
65+
* ...
66+
*
67+
* onRender {
68+
* ExampleFont.CoolFont.bind(slot = x)
69+
* }
70+
* ```
5471
*/
5572
object LambdaAtlas {
5673
private val fontMap = Object2ObjectOpenHashMap<Any, Int2ObjectArrayMap<GlyphInfo>>()

0 commit comments

Comments
 (0)