reepblue Posted August 16 Posted August 16 Text shows a blurry mess. You can try this in the editor. font = LoadFont("Fonts/arial.ttf", 24) sprite = CreateSprite(program.world, font, "Hello", TEXT_LEFT | TEXT_TOP) o = CreateGameObject(sprite) 1 Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon!
Solution Josh Posted August 26 Solution Posted August 26 The problem is you are supplying TEXT_LEFT | TEXT_TOP as the size argument. It looks like the documentation is already correct, so I think there is no bug: https://www.leadwerks.com/learn/CreateSprite?lang=lua Corrected Lua code: font = LoadFont("Fonts/arial.ttf", 24) sprite = CreateSprite(program.world, font, "Hello", 24, TEXT_LEFT | TEXT_TOP) o = CreateGameObject(sprite) Here is a test program that shows it working. #include "Leadwerks.h" using namespace Leadwerks; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create framebuffer auto framebuffer = CreateFramebuffer(window); //Create world auto world = CreateWorld(); //Create camera auto camera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); camera->SetClearColor(0.125); //Create sprite auto font = LoadFont("Fonts/arial.ttf"); auto sprite = CreateSprite(world, font, "Test this out!", 24); //Main loop while (window->Closed() == false and window->KeyHit(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; } 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.