Added RocketGui_button
This commit is contained in:
parent
64e2a5bd47
commit
c33f759c26
@ -45,6 +45,15 @@ void Editor_guiUpdate()
|
|||||||
|
|
||||||
RocketGui_beginHorizontalStackPanelXY(2, 2);
|
RocketGui_beginHorizontalStackPanelXY(2, 2);
|
||||||
|
|
||||||
|
if (RocketGui_button("PressMeNow!"))
|
||||||
|
{
|
||||||
|
RocketGui_textLabel("Pressed!");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RocketGui_textLabel("No Press0r!");
|
||||||
|
}
|
||||||
|
|
||||||
RocketGui_textLabel("Test");
|
RocketGui_textLabel("Test");
|
||||||
RocketGui_textLabel("Test2");
|
RocketGui_textLabel("Test2");
|
||||||
RocketGui_textLabel("Test");
|
RocketGui_textLabel("Test");
|
||||||
|
|||||||
@ -475,6 +475,35 @@ bool RocketGui_buttonImage(const char* filename)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
bool RocketGui_button(const char* text)
|
||||||
|
{
|
||||||
|
RocketControlInfo* control;
|
||||||
|
uint32_t controlId = 0;
|
||||||
|
|
||||||
|
control = RocketGui_textLabel(text);
|
||||||
|
controlId = s_controlId - 1;
|
||||||
|
|
||||||
|
if (controlId == ~0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
control = &g_controls[controlId];
|
||||||
|
|
||||||
|
if (RocketGui_regionHit(control))
|
||||||
|
{
|
||||||
|
g_rocketGuiState.hotItem = controlId;
|
||||||
|
if (g_rocketGuiState.activeItem == 0 && g_rocketGuiState.mouseDown)
|
||||||
|
g_rocketGuiState.activeItem = controlId;
|
||||||
|
|
||||||
|
//highlightControl(control);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (g_rocketGuiState.mouseDown == 0 && g_rocketGuiState.hotItem == controlId && g_rocketGuiState.activeItem == controlId)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user