implemented font reader

This commit is contained in:
devZoGok
2022-03-02 20:24:04 +02:00
parent 77e00b0a64
commit 35ccac66b9
8 changed files with 104 additions and 17 deletions
+7
View File
@@ -6,6 +6,9 @@
#include "node.h"
#include "animationController.h"
#include "animationChannel.h"
#include "imageReader.h"
#include "fontReader.h"
#include "assetManager.h"
using namespace std;
using namespace vb01;
@@ -55,10 +58,14 @@ int main(){
textMat->addBoolUniform("texturingEnabled", true);
string frames[]{TEX_PATH + "bricks.jpg", TEX_PATH + "defaultTexture.jpg"};
AssetManager::getSingleton()->load(ImageReader::getSingleton(), frames[0]);
AssetManager::getSingleton()->load(ImageReader::getSingleton(), frames[1]);
Texture *texture = new Texture(frames, 2, false);
textMat->addTexUniform("textures[0]", texture, true);
for(int i = 0; i < numTexts; i++){
AssetManager::getSingleton()->load(FontReader::getSingleton(), FONT_PATH + fonts[i]);
Text *text = new Text(FONT_PATH + fonts[i], texts[i], 0, 60000);
text->setLeftToRight(leftToRight[i]);
text->setScale(.5);