Jump to content

Recommended Posts

Posted

If you want to make the window background black before graphics start rendering, here is one possible way:

auto window = CreateWindow("Leadwerks", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR | WINDOW_HIDDEN);
auto ui = CreateInterface(window);
ui->background->SetColor(0,0,0);
window->SetHidden(false);
window->Activate();
ui = nullptr;

If you do this in Lua make sure you call collectgarbage() to delete the UI object.

  • Like 1

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

Posted

I thought that with a 3D world it wouldn't be feasible because I would have to go through the process of creating the world and then creating the UI to give it that color. And it would always remain white. 

 

 

Astrocuco.thumb.png.c76e0fb3de2d6e437e7dca099625e11e.png

Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games

Posted

It doesn't work in Lua, the window is white. 
 

-- Objects
local window = CWindow:New()

ui = CreateInterface(window:Get())

ui.background:SetColor(0,0,0)

window:Get():SetHidden(false);
window:Get():Activate()
ui = nil

 

 

 

Astrocuco.thumb.png.c76e0fb3de2d6e437e7dca099625e11e.png

Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games

Posted
32 minutes ago, Yue said:

It doesn't work in Lua, the window is white. 
 

-- Objects
local window = CWindow:New()

ui = CreateInterface(window:Get())

ui.background:SetColor(0,0,0)

window:Get():SetHidden(false);
window:Get():Activate()
ui = nil

 

You window probably isn't hidden to start with.

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...