diff options
| author | jussi | 2024-02-05 22:40:31 +0200 |
|---|---|---|
| committer | jussi | 2024-02-05 22:40:31 +0200 |
| commit | eda4eacfce4f62ca09fb4f6559f9b7aeabe3cc31 (patch) | |
| tree | 110cf3da59fb0b646272c28a2df7570527f4ddb6 /examples/raygui_extensions | |
| parent | d21512d88c2e24cf8cb230d29fb253fb5efd1661 (diff) | |
| download | reilua-enhanced-eda4eacfce4f62ca09fb4f6559f9b7aeabe3cc31.tar.gz reilua-enhanced-eda4eacfce4f62ca09fb4f6559f9b7aeabe3cc31.tar.bz2 reilua-enhanced-eda4eacfce4f62ca09fb4f6559f9b7aeabe3cc31.zip | |
Raygui styles include properties, texture and font.
Diffstat (limited to 'examples/raygui_extensions')
| -rw-r--r-- | examples/raygui_extensions/main.lua | 29 | ||||
| -rw-r--r-- | examples/raygui_extensions/property_list.lua | 4 |
2 files changed, 20 insertions, 13 deletions
diff --git a/examples/raygui_extensions/main.lua b/examples/raygui_extensions/main.lua index e52c96d..8ce1913 100644 --- a/examples/raygui_extensions/main.lua +++ b/examples/raygui_extensions/main.lua @@ -35,11 +35,13 @@ local function addButton( bounds, text, callback ) { source = { 48, 0, 48, 48 }, left = 16, top = 16, right = 16, bottom = 16, layout = RL.NPATCH_NINE_PATCH }, callback, { - { RL.LABEL, RL.TEXT_ALIGNMENT, RL.TEXT_ALIGN_CENTER }, - { RL.DEFAULT, RL.TEXT_SIZE, 32 }, - { RL.LABEL, RL.TEXT_COLOR_NORMAL, RL.ColorToInt( { 84, 59, 22 } ) }, - { RL.LABEL, RL.TEXT_COLOR_PRESSED, RL.ColorToInt( { 84/2, 59/2, 22/2 } ) }, - { RL.LABEL, RL.TEXT_COLOR_FOCUSED, RL.ColorToInt( RL.GREEN ) }, + properties = { + { RL.LABEL, RL.TEXT_ALIGNMENT, RL.TEXT_ALIGN_CENTER }, + { RL.DEFAULT, RL.TEXT_SIZE, 32 }, + { RL.LABEL, RL.TEXT_COLOR_NORMAL, RL.ColorToInt( { 84, 59, 22 } ) }, + { RL.LABEL, RL.TEXT_COLOR_PRESSED, RL.ColorToInt( { 84/2, 59/2, 22/2 } ) }, + { RL.LABEL, RL.TEXT_COLOR_FOCUSED, RL.ColorToInt( RL.GREEN ) }, + }, } ) end @@ -75,7 +77,9 @@ local function addPropertyList() function( self ) Gui:set2Top( self ) end, nil, { - { RL.SCROLLBAR, RL.ARROWS_VISIBLE, RL.ARROWS_VISIBLE }, + properties = { + { RL.SCROLLBAR, RL.ARROWS_VISIBLE, RL.ARROWS_VISIBLE }, + } } ) RL.GuiSetStyle( RL.SPINNER, RL.TEXT_ALIGNMENT, RL.TEXT_ALIGN_LEFT ) @@ -148,9 +152,6 @@ local function addPropertyList() "Flipped", cat.flipped, function( self ) cat.flipped = self.checked end - -- { - -- { RL.CHECKBOX, RL.TEXT_ALIGNMENT, RL.TEXT_ALIGN_RIGHT } - -- } ), transformGroup ) -- Visibility. @@ -163,7 +164,9 @@ local function addPropertyList() cat.visible, function( self ) cat.visible = self.checked end, { - { RL.CHECKBOX, RL.TEXT_ALIGNMENT, RL.TEXT_ALIGN_RIGHT } + properties = { + { RL.CHECKBOX, RL.TEXT_ALIGNMENT, RL.TEXT_ALIGN_RIGHT }, + } } ), visibilityGroup ) @@ -199,8 +202,10 @@ local function addPropertyList() false, function( self ) print( "Checked" ) end, { - -- { RL.CHECKBOX, RL.TEXT_ALIGNMENT, RL.TEXT_ALIGN_LEFT }, - { RL.DEFAULT, RL.TEXT_SIZE, 32 } + properties = { + -- { RL.CHECKBOX, RL.TEXT_ALIGNMENT, RL.TEXT_ALIGN_LEFT }, + { RL.DEFAULT, RL.TEXT_SIZE, 32 } + } } ), test ) end diff --git a/examples/raygui_extensions/property_list.lua b/examples/raygui_extensions/property_list.lua index 04c2b78..35f2f36 100644 --- a/examples/raygui_extensions/property_list.lua +++ b/examples/raygui_extensions/property_list.lua @@ -141,7 +141,9 @@ function PropertyList:addGroup( name, active, group ) active, function( this ) this.text = setGroupText( name, this.active ) self:updateContent() end, { - { RL.TOGGLE, RL.TEXT_ALIGNMENT, RL.TEXT_ALIGN_LEFT } + properties = { + { RL.TOGGLE, RL.TEXT_ALIGNMENT, RL.TEXT_ALIGN_LEFT } + } } ) control._controls = {} -- Prefix _ to try to prevent clashing with control definition. |
