implement multiline text rendering
This commit is contained in:
@@ -56,6 +56,7 @@ namespace OpenVulkano
|
||||
texts.push_back(std::make_pair("ABab?.^{}_cdFGETG123)(", TextConfig()));
|
||||
texts.push_back(std::make_pair("Hello, World!", TextConfig()));
|
||||
texts.push_back(std::make_pair("\u0410\u0411\u0412\u041F", TextConfig()));
|
||||
texts.push_back(std::make_pair("This is first line\nSecond gg line\nThird G line", TextConfig()));
|
||||
texts[0].second.applyBorder = true;
|
||||
texts[1].second.backgroundColor.a = 1;
|
||||
|
||||
@@ -73,7 +74,7 @@ namespace OpenVulkano
|
||||
}
|
||||
|
||||
#ifdef MSDFGEN_AVAILABLE
|
||||
m_atlasGenerator.GenerateAtlas(fontPath, charset);
|
||||
m_atlasGenerator.GenerateAtlas(fontPath, charset, "roboto-regular-atlas.png");
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < texts.size(); i++)
|
||||
@@ -81,9 +82,8 @@ namespace OpenVulkano
|
||||
#ifdef MSDFGEN_AVAILABLE
|
||||
TextDrawable* t = new TextDrawable(&m_atlasGenerator, texts[i].second);
|
||||
#else
|
||||
auto metadataInfoPath = resourceLoader.GetResourcePath("atlas_metadata");
|
||||
auto metadataInfo = resourceLoader.GetResource("atlas_metadata");
|
||||
auto data = resourceLoader.GetResource("roboto-regular-atlas.png");
|
||||
auto metadataInfo = TextDrawable::ReadAtlasMetadataFile(metadataInfoPath);
|
||||
Image::ImageLoaderPng loader;
|
||||
static auto image = loader.loadData(reinterpret_cast<uint8_t*>(data.Data()), data.Size());
|
||||
static Texture tex;
|
||||
|
||||
Reference in New Issue
Block a user