add text parameter to GuiScrollPanel examples (#176)
* add text parameter to GuiScrollPanel examples * move guiIconName to declarations
This commit is contained in:
parent
cc359132b6
commit
1f0dbc8aa1
@ -197,7 +197,7 @@ int main()
|
||||
progressValue = GuiProgressBar((Rectangle){ 320, 460, 200, 20 }, NULL, NULL, progressValue, 0, 1);
|
||||
|
||||
// NOTE: View rectangle could be used to perform some scissor test
|
||||
Rectangle view = GuiScrollPanel((Rectangle){ 560, 25, 100, 160 }, (Rectangle){ 560, 25, 200, 400 }, &viewScroll);
|
||||
Rectangle view = GuiScrollPanel((Rectangle){ 560, 25, 100, 160 }, "", (Rectangle){ 560, 25, 200, 400 }, &viewScroll);
|
||||
|
||||
GuiStatusBar((Rectangle){ 0, GetScreenHeight() - 20, GetScreenWidth(), 20 }, "This is a status bar");
|
||||
|
||||
|
@ -66,7 +66,7 @@ int main()
|
||||
|
||||
DrawText(TextFormat("[%f, %f]", panelScroll.x, panelScroll.y), 4, 4, 20, RED);
|
||||
|
||||
Rectangle view = GuiScrollPanel(panelRec, panelContentRec, &panelScroll);
|
||||
Rectangle view = GuiScrollPanel(panelRec, "", panelContentRec, &panelScroll);
|
||||
|
||||
BeginScissorMode(view.x, view.y, view.width, view.height);
|
||||
GuiGrid((Rectangle){panelRec.x + panelScroll.x, panelRec.y + panelScroll.y, panelContentRec.width, panelContentRec.height}, 16, 3);
|
||||
|
83
src/raygui.h
83
src/raygui.h
@ -556,47 +556,8 @@ RAYGUIAPI void GuiSetIconData(int iconId, unsigned int *data); // Set icon bit
|
||||
RAYGUIAPI void GuiSetIconPixel(int iconId, int x, int y); // Set icon pixel value
|
||||
RAYGUIAPI void GuiClearIconPixel(int iconId, int x, int y); // Clear icon pixel value
|
||||
RAYGUIAPI bool GuiCheckIconPixel(int iconId, int x, int y); // Check icon pixel value
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
} // Prevents name mangling of functions
|
||||
#endif
|
||||
|
||||
#endif // RAYGUI_H
|
||||
|
||||
/***********************************************************************************
|
||||
*
|
||||
* RAYGUI IMPLEMENTATION
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#if defined(RAYGUI_IMPLEMENTATION)
|
||||
|
||||
#include <stdio.h> // Required for: FILE, fopen(), fclose(), fprintf(), feof(), fscanf(), vsprintf() [GuiLoadStyle(), GuiLoadIcons()]
|
||||
#include <stdlib.h> // Required for: malloc(), calloc(), free() [GuiLoadStyle(), GuiLoadIcons()]
|
||||
#include <string.h> // Required for: strlen() [GuiTextBox(), GuiTextBoxMulti(), GuiValueBox()], memset(), memcpy()
|
||||
#include <stdarg.h> // Required for: va_list, va_start(), vfprintf(), va_end() [TextFormat()]
|
||||
#include <math.h> // Required for: roundf() [GuiColorPicker()]
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define RAYGUI_CLITERAL(name) name
|
||||
#else
|
||||
#define RAYGUI_CLITERAL(name) (name)
|
||||
#endif
|
||||
|
||||
#if !defined(RAYGUI_NO_ICONS) && !defined(RAYGUI_CUSTOM_ICONS)
|
||||
|
||||
// Embedded raygui icons, no external file provided
|
||||
#define RAYGUI_ICON_SIZE 16 // Size of icons (squared)
|
||||
#define RAYGUI_ICON_MAX_ICONS 256 // Maximum number of icons
|
||||
#define RAYGUI_ICON_MAX_NAME_LENGTH 32 // Maximum length of icon name id
|
||||
|
||||
// Icons data is defined by bit array (every bit represents one pixel)
|
||||
// Those arrays are stored as unsigned int data arrays, so every array
|
||||
// element defines 32 pixels (bits) of information
|
||||
// Number of elemens depend on RAYGUI_ICON_SIZE (by default 16x16 pixels)
|
||||
#define RAYGUI_ICON_DATA_ELEMENTS (RAYGUI_ICON_SIZE*RAYGUI_ICON_SIZE/32)
|
||||
|
||||
#if !defined(RAYGUI_CUSTOM_ICONS)
|
||||
//----------------------------------------------------------------------------------
|
||||
// Icons enumeration
|
||||
//----------------------------------------------------------------------------------
|
||||
@ -858,6 +819,48 @@ typedef enum {
|
||||
RAYGUI_ICON_254 = 254,
|
||||
RAYGUI_ICON_255 = 255,
|
||||
} guiIconName;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
} // Prevents name mangling of functions
|
||||
#endif
|
||||
|
||||
#endif // RAYGUI_H
|
||||
|
||||
/***********************************************************************************
|
||||
*
|
||||
* RAYGUI IMPLEMENTATION
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#if defined(RAYGUI_IMPLEMENTATION)
|
||||
|
||||
#include <stdio.h> // Required for: FILE, fopen(), fclose(), fprintf(), feof(), fscanf(), vsprintf() [GuiLoadStyle(), GuiLoadIcons()]
|
||||
#include <stdlib.h> // Required for: malloc(), calloc(), free() [GuiLoadStyle(), GuiLoadIcons()]
|
||||
#include <string.h> // Required for: strlen() [GuiTextBox(), GuiTextBoxMulti(), GuiValueBox()], memset(), memcpy()
|
||||
#include <stdarg.h> // Required for: va_list, va_start(), vfprintf(), va_end() [TextFormat()]
|
||||
#include <math.h> // Required for: roundf() [GuiColorPicker()]
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define RAYGUI_CLITERAL(name) name
|
||||
#else
|
||||
#define RAYGUI_CLITERAL(name) (name)
|
||||
#endif
|
||||
|
||||
#if !defined(RAYGUI_NO_ICONS) && !defined(RAYGUI_CUSTOM_ICONS)
|
||||
|
||||
// Embedded raygui icons, no external file provided
|
||||
#define RAYGUI_ICON_SIZE 16 // Size of icons (squared)
|
||||
#define RAYGUI_ICON_MAX_ICONS 256 // Maximum number of icons
|
||||
#define RAYGUI_ICON_MAX_NAME_LENGTH 32 // Maximum length of icon name id
|
||||
|
||||
// Icons data is defined by bit array (every bit represents one pixel)
|
||||
// Those arrays are stored as unsigned int data arrays, so every array
|
||||
// element defines 32 pixels (bits) of information
|
||||
// Number of elemens depend on RAYGUI_ICON_SIZE (by default 16x16 pixels)
|
||||
#define RAYGUI_ICON_DATA_ELEMENTS (RAYGUI_ICON_SIZE*RAYGUI_ICON_SIZE/32)
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
// Icons data for all gui possible icons (allocated on data segment by default)
|
||||
|
Loading…
x
Reference in New Issue
Block a user