Jump to content

Bottom border line of widgets is one pixel offseted


Go to solution Solved by Josh,

Recommended Posts

Posted

Bottom border line is pixel lower than should be

#include "UltraEngine.h"

using namespace UltraEngine;

shared_ptr<Window> window;
shared_ptr<Framebuffer> framebuffer;
shared_ptr<World> menuWold;
shared_ptr<Interface> ui;
shared_ptr<Camera> uiCamera;

void initGui()
{
    auto default_font = LoadFont("Fonts\\arial.ttf");
    ui = CreateInterface(menuWold, default_font, framebuffer->GetSize());
    ui->SetRenderLayers(2);
    ui->root->SetColor(0.5f, 0.5f, 0.5f, 1.0f);
    uiCamera = CreateCamera(menuWold, PROJECTION_ORTHOGRAPHIC);
    uiCamera->SetPosition((float)framebuffer->GetSize().x * 0.5f, (float)framebuffer->GetSize().y * 0.5f, 0);
    uiCamera->SetRenderLayers(2);
    uiCamera->SetClearMode(CLEAR_DEPTH);
}


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

    initGui();

    auto btn = CreateButton("", 10, 10, 32, 32, ui->root);

    while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
    {
        menuWold->Update();
        menuWold->Render(framebuffer);
    }
    return 0;
}

 

  • Thanks 1

Check out Slipgate Tactics demo, which is made with Ultra Engine/Leadwerks 5:

https://www.leadwerks.com/community/topic/61480-slipgate-tactics-demo/

  • 2 months later...
  • Solution
Posted

Seems fine now?

image.png.58d6b5c675726ebb49ad4df8097a87db.png

#include "UltraEngine.h"

using namespace UltraEngine;

shared_ptr<Window> window;
shared_ptr<Framebuffer> framebuffer;
shared_ptr<World> menuWold;
shared_ptr<Interface> ui;
shared_ptr<Camera> uiCamera;

void initGui()
{
    uiCamera = CreateCamera(menuWold, PROJECTION_ORTHOGRAPHIC);
    auto default_font = LoadFont("Fonts\\arial.ttf");
    ui = CreateInterface(uiCamera, default_font, framebuffer->GetSize());
    ui->SetRenderLayers(2);
    ui->root->SetColor(0.5f, 0.5f, 0.5f, 1.0f);
    uiCamera->SetPosition((float)framebuffer->GetSize().x * 0.5f, (float)framebuffer->GetSize().y * 0.5f, 0);
    uiCamera->SetRenderLayers(2);
    uiCamera->SetClearMode(CLEAR_DEPTH);
}


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

    initGui();

    auto btn = CreateButton("", 10, 10, 32, 32, ui->root);

    while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
    {
        menuWold->Update();
        menuWold->Render(framebuffer);
    }
    return 0;
}

 

Let's build cool stuff and have fun. :)

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...