AtlasGL.kl¶
Types¶
AtlasGL (object)¶
バージョン 2.4.0 で追加.
AtlasGL extends FreeTypeAtlas to draw 2D text with FabricOGL. It’s in charge of generating and binding an OpenGL Texture from the atlas. It also provides high level methods to set the atlas properties (font and glyphs).
The size of the atlas (and of the OpenGL texture) can be big if a lot of glyphs are used. For performances and memory reasons, the same atlas should be shared between several TextGL objects. For this purpose, the atlas are registered as a singleton. The name of the singleton is created from the font path and size.
Members¶
String | fontPath | Path of the used font. |
String | glyphs | List of glyphs character. |
/*
** Example: AtlasGL
*/
require Text;
operator entry() {
Float32 fontSize = 20;
FilePath fontPath = FilePath('${FABRIC_DIR}/Resources/Fonts/Roboto/Roboto-Regular.ttf');
Ref<AtlasGL> atlas = GetOrCreateAtlasGL(fontPath, fontSize);
Ref<AtlasGL> atlas2 = GetAtlasGL(fontPath, fontSize);
}
/*
** Output:
*/