mirror of
https://github.com/raysan5/raygui.git
synced 2025-12-25 10:22:33 -05:00
Testing dark style loading
This commit is contained in:
@ -46,19 +46,20 @@ int main(int argc, char *argv[0])
|
|||||||
|
|
||||||
bool showImportPanel = false;
|
bool showImportPanel = false;
|
||||||
bool imageLoaded = false;
|
bool imageLoaded = false;
|
||||||
|
|
||||||
float imageScale = 1.0f;
|
float imageScale = 1.0f;
|
||||||
|
|
||||||
InitWindow(SCREEN_WIDTH, SCREEN_HEIGHT, "raw image importer");
|
|
||||||
|
|
||||||
Texture2D texture = { 0 };
|
|
||||||
|
|
||||||
// Raw image import values
|
// Raw image import values
|
||||||
int width = 0;
|
int width = 0;
|
||||||
int height = 0;
|
int height = 0;
|
||||||
int format = UNCOMPRESSED_R8G8B8A8;
|
int format = UNCOMPRESSED_R8G8B8A8;
|
||||||
int headerSize = 0;
|
int headerSize = 0;
|
||||||
|
|
||||||
|
LoadGuiStyleImage("rguistyle_default_dark.png");
|
||||||
|
|
||||||
|
InitWindow(SCREEN_WIDTH, SCREEN_HEIGHT, "raw image importer");
|
||||||
|
|
||||||
|
Texture2D texture = { 0 };
|
||||||
|
|
||||||
SetTargetFPS(60);
|
SetTargetFPS(60);
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -142,28 +143,25 @@ int main(int argc, char *argv[0])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (imageLoaded)
|
if (imageLoaded) imageScale += (float)GetMouseWheelMove(); // Image scale control
|
||||||
{
|
|
||||||
// Image scale control
|
|
||||||
imageScale += (float)GetMouseWheelMove();
|
|
||||||
}
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
BeginDrawing();
|
BeginDrawing();
|
||||||
|
|
||||||
ClearBackground(RAYWHITE);
|
ClearBackground(GuiBackgroundColor());
|
||||||
|
|
||||||
DrawRectangleLines(10, 10, SCREEN_WIDTH - 20, SCREEN_HEIGHT - 20, GuiLinesColor());
|
DrawRectangleLines(10, 10, SCREEN_WIDTH - 20, SCREEN_HEIGHT - 20, GuiLinesColor());
|
||||||
|
|
||||||
if (texture.id != 0)
|
if (texture.id != 0)
|
||||||
{
|
{
|
||||||
DrawTextureEx(texture, (Vector2){ SCREEN_WIDTH/2 - texture.width*imageScale/2, SCREEN_HEIGHT/2 - texture.height*imageScale/2 }, 0, imageScale, WHITE);
|
DrawTextureEx(texture, (Vector2){ SCREEN_WIDTH/2 - texture.width*imageScale/2, SCREEN_HEIGHT/2 - texture.height*imageScale/2 }, 0, imageScale, WHITE);
|
||||||
DrawText(FormatText("SCALE x%.0f", imageScale), 20, SCREEN_HEIGHT - 40, 20, LIGHTGRAY);
|
DrawText(FormatText("SCALE x%.0f", imageScale), 20, SCREEN_HEIGHT - 40, 20, GuiTextColor());
|
||||||
|
|
||||||
}
|
}
|
||||||
else DrawText("drag & drop RAW image file", 320, 180, 10, GRAY);
|
else DrawText("drag & drop RAW image file", 320, 180, 10, GuiTextColor());
|
||||||
|
|
||||||
if (showImportPanel)
|
if (showImportPanel)
|
||||||
{
|
{
|
||||||
|
|||||||
BIN
examples/raw_importer/rguistyle_default_dark.png
Normal file
BIN
examples/raw_importer/rguistyle_default_dark.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
Reference in New Issue
Block a user