This method sets a widget's color value.
Parameter | Description |
---|---|
r | red component of the color to set |
g | green component of the color to set |
b | blue component of the color to set |
a | alpha component of the color to set |
color | color to set |
index | color index |
The color index can be any of the following values:
#include "UltraEngine.h"
using namespace UltraEngine;
int main(int argc, const char* argv[])
{
// Get the displays
auto displays = GetDisplays();
// Create a window
auto window = CreateWindow("Ultra Engine", 0, 0, 800, 600, displays[0]);
// Create User Interface
auto ui = CreateInterface(window);
auto sz = ui->root->ClientSize();
// Create widget
auto panel = CreatePanel(50, 50, sz.x - 100, sz.y - 100, ui->root);
// Fade to black over ten seconds
panel->SetColor(0, 0, 0, 1, WIDGETCOLOR_BACKGROUND, 10000);
while (true)
{
const Event ev = WaitEvent();
switch (ev.id)
{
case EVENT_WINDOWCLOSE:
return 0;
break;
}
}
return 0;
}