Jump to content

Invisible Text Field


SpiderPig
 Share

Go to solution Solved by Josh,

Recommended Posts

I noticed this a while ago just briefly.  Text area works but text field is not visible.  The project is up to date.

#include "UltraEngine.h"
#include "ComponentSystem.h"
using namespace UltraEngine;

int main(int argc, const char* argv[])
{
    auto displays = GetDisplays();
    auto window = CreateWindow("Ultra Engine", 0, 0, 1440, 900, displays[0]);
    auto framebuffer = CreateFramebuffer(window);
    auto world = CreateWorld();

    auto camera = CreateCamera(world);
    camera->Move(0, 2, -3);
    camera->SetClearColor(1, 0, 0);

    auto light = CreateDirectionalLight(world);
    light->SetRotation(35, 35, 35);

    auto floor = CreateBox(world, 100.0f, 0.5f, 100.0f);

    auto default_font = LoadFont("Fonts\\arial.ttf");
    auto ui = CreateInterface(world, default_font, framebuffer->size);
    ui->SetRenderLayers(2);
    ui->root->SetColor(0.0f, 0.0f, 0.0f, 0.0f);

    auto ui_camera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC);
    ui_camera->SetPosition((float)framebuffer->size.x * 0.5f, (float)framebuffer->size.y * 0.5f, 0);
    ui_camera->SetRenderLayers(2);
    ui_camera->SetClearMode(CLEAR_DEPTH);

    //auto text = CreateTextArea(0, 0, 512, 30, ui->root);
    auto text = CreateTextField(0, 0, 512, 30, ui->root);
    text->SetText("Hello Ultra");

    while (window->KeyHit(KEY_ESCAPE) == false && window->Closed() == false)
    {
        while (PeekEvent()) {
            ui->ProcessEvent(WaitEvent());
        }

        world->Update();
        world->Render(framebuffer);
    }
    return 0;
}

 

Link to comment
Share on other sites

  • 2 months later...

I want to focus on the editor first because any changes I make to the GUI system could affect this issue, rather than the reverse.

  • Upvote 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

  • 3 months later...

Simplifying this a bit...

#include "UltraEngine.h"

using namespace UltraEngine;

int main(int argc, const char* argv[])
{
    auto displays = GetDisplays();
    auto window = CreateWindow("Ultra Engine", 0, 0, 1440, 900, displays[0]);
    auto framebuffer = CreateFramebuffer(window);
    auto world = CreateWorld();

    auto default_font = LoadFont("Fonts\\arial.ttf");
    auto ui = CreateInterface(world, default_font, framebuffer->size);
    
    auto ui_camera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC);
    ui_camera->SetPosition((float)framebuffer->size.x * 0.5f, (float)framebuffer->size.y * 0.5f, 0);
    
    auto text1 = CreateTextArea(10, 10, 512, 30, ui->root);
    auto text2 = CreateTextField(10, 50, 512, 30, ui->root);
    text1->SetText("Hello Ultra");
    text2->SetText("Hello Ultra");

    while (window->KeyHit(KEY_ESCAPE) == false && window->Closed() == false)
    {
        while (PeekEvent()) {
            ui->ProcessEvent(WaitEvent());
        }

        world->Update();
        world->Render(framebuffer);
    }
    return 0;
}

 

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

  • Josh locked this topic
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...