mirror of
https://github.com/raysan5/raygui.git
synced 2026-08-26 06:08:28 -04:00
Compare commits
4 Commits
4f917532aa
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| fbf5d95e19 | |||
| 0132e47671 | |||
| 9fed992452 | |||
| 70f440b2d1 |
@ -324,7 +324,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
|||||||
ifeq ($(PLATFORM_OS),OSX)
|
ifeq ($(PLATFORM_OS),OSX)
|
||||||
# Libraries for OSX 10.9 desktop compiling
|
# Libraries for OSX 10.9 desktop compiling
|
||||||
# NOTE: Required packages: libopenal-dev libegl1-mesa-dev
|
# NOTE: Required packages: libopenal-dev libegl1-mesa-dev
|
||||||
LDLIBS = -lraylib -framework OpenGL -framework Cocoa -framework IOKit -framework CoreAudio -framework CoreVideo
|
LDLIBS = -lraylib -framework OpenGL -framework Cocoa -framework IOKit -framework CoreAudio -framework CoreVideo -framework QuartzCore
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),BSD)
|
ifeq ($(PLATFORM_OS),BSD)
|
||||||
# Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling
|
# Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling
|
||||||
|
|||||||
@ -1,71 +0,0 @@
|
|||||||
/*******************************************************************************************
|
|
||||||
*
|
|
||||||
* raygui - controls test suite
|
|
||||||
*
|
|
||||||
* COMPILATION (Windows - MinGW):
|
|
||||||
* gcc -o $(NAME_PART).exe $(FILE_NAME) -I../../src -lraylib -lopengl32 -lgdi32 -std=c99
|
|
||||||
*
|
|
||||||
* LICENSE: zlib/libpng
|
|
||||||
*
|
|
||||||
* Copyright (c) 2016-2024 Ramon Santamaria (@raysan5)
|
|
||||||
*
|
|
||||||
**********************************************************************************************/
|
|
||||||
|
|
||||||
#include "raylib.h"
|
|
||||||
|
|
||||||
#define RAYGUI_IMPLEMENTATION
|
|
||||||
#include "../../src/raygui.h"
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------
|
|
||||||
// Program main entry point
|
|
||||||
//------------------------------------------------------------------------------------
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
// Initialization
|
|
||||||
//---------------------------------------------------------------------------------------
|
|
||||||
const int screenWidth = 800;
|
|
||||||
const int screenHeight = 450;
|
|
||||||
|
|
||||||
InitWindow(screenWidth, screenHeight, "raygui - controls test suite");
|
|
||||||
|
|
||||||
float valueBoxValue = 0.0f;
|
|
||||||
bool valueBoxEditMode = false;
|
|
||||||
char valueBoxTextValue[32] = { 0 };
|
|
||||||
|
|
||||||
SetTargetFPS(60);
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// Main game loop
|
|
||||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
|
||||||
{
|
|
||||||
// Update
|
|
||||||
//----------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// Draw
|
|
||||||
//----------------------------------------------------------------------------------
|
|
||||||
BeginDrawing();
|
|
||||||
|
|
||||||
ClearBackground(GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR)));
|
|
||||||
|
|
||||||
if (GuiValueBoxFloat((Rectangle){ 25, 175, 125, 30 }, NULL, valueBoxTextValue, &valueBoxValue, valueBoxEditMode))
|
|
||||||
{
|
|
||||||
valueBoxEditMode = !valueBoxEditMode;
|
|
||||||
|
|
||||||
printf("Value: %2.2f\n", valueBoxValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
EndDrawing();
|
|
||||||
//----------------------------------------------------------------------------------
|
|
||||||
}
|
|
||||||
|
|
||||||
// De-Initialization
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
CloseWindow(); // Close window and OpenGL context
|
|
||||||
//--------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
10
src/raygui.h
10
src/raygui.h
@ -4449,11 +4449,11 @@ int GuiTextInputBox(Rectangle bounds, const char *title, const char *message, ch
|
|||||||
Rectangle textBounds = { 0 };
|
Rectangle textBounds = { 0 };
|
||||||
if (message != NULL)
|
if (message != NULL)
|
||||||
{
|
{
|
||||||
int textSize = GuiGetTextWidth(message) + 2;
|
int messageTextSize = GuiGetTextWidth(message) + 2;
|
||||||
|
|
||||||
textBounds.x = bounds.x + bounds.width/2 - textSize/2;
|
textBounds.x = bounds.x + bounds.width/2 - messageTextSize/2;
|
||||||
textBounds.y = bounds.y + RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT + messageInputHeight/4 - (float)GuiGetStyle(DEFAULT, TEXT_SIZE)/2;
|
textBounds.y = bounds.y + RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT + messageInputHeight/4 - (float)GuiGetStyle(DEFAULT, TEXT_SIZE)/2;
|
||||||
textBounds.width = (float)textSize;
|
textBounds.width = (float)messageTextSize;
|
||||||
textBounds.height = (float)GuiGetStyle(DEFAULT, TEXT_SIZE);
|
textBounds.height = (float)GuiGetStyle(DEFAULT, TEXT_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4641,8 +4641,8 @@ void GuiLoadStyle(const char *fileName)
|
|||||||
{
|
{
|
||||||
case 'v':
|
case 'v':
|
||||||
{
|
{
|
||||||
sscanf(buffer, "v %d", &version);
|
sscanf(buffer, "v %u", &version);
|
||||||
}
|
} break;
|
||||||
case 'p':
|
case 'p':
|
||||||
{
|
{
|
||||||
// Style property: p <control_id> <property_id> <property_value> <property_name>
|
// Style property: p <control_id> <property_id> <property_value> <property_name>
|
||||||
|
|||||||
Reference in New Issue
Block a user