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_lib/main.lua | |
| 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_lib/main.lua')
| -rw-r--r-- | examples/raygui_lib/main.lua | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/examples/raygui_lib/main.lua b/examples/raygui_lib/main.lua index 0bb01fb..fcc6ea0 100644 --- a/examples/raygui_lib/main.lua +++ b/examples/raygui_lib/main.lua @@ -70,13 +70,14 @@ function RL.init() "Dog", function() toggleGroup:setText( "Dog;Cat\nEagle" ) end, { - { RL.DEFAULT, RL.TEXT_COLOR_NORMAL, RL.ColorToInt( RL.RED ) }, - { RL.DEFAULT, RL.TEXT_COLOR_FOCUSED, RL.ColorToInt( RL.ORANGE ) }, - { RL.DEFAULT, RL.TEXT_COLOR_PRESSED, RL.ColorToInt( RL.GREEN ) }, + properties = { + { RL.DEFAULT, RL.TEXT_COLOR_NORMAL, RL.ColorToInt( RL.RED ) }, + { RL.DEFAULT, RL.TEXT_COLOR_FOCUSED, RL.ColorToInt( RL.ORANGE ) }, + { RL.DEFAULT, RL.TEXT_COLOR_PRESSED, RL.ColorToInt( RL.GREEN ) }, + }, + texture = { texture = texture, rect = textureRect }, } ) - button.texture = texture - button.textureRect = textureRect local checkbox = Gui:CheckBox( Rect:new( 116, 128, 20, 20 ), "Visible", @@ -140,10 +141,11 @@ function RL.init() 0, 0, 100, - function( self ) print( "Changed value "..self.value ) end + function( self ) print( "Changed value "..self.value ) end, + { + texture = { texture = texture, rect = textureRect }, + } ) - slider.texture = texture - slider.textureRect = textureRect local sliderbar = Gui:SliderBar( Rect:new( 50, 550, 256, 32 ), "min", @@ -185,11 +187,12 @@ function RL.init() function( self ) Gui:set2Top( self ) end, nil, { - { RL.DEFAULT, RL.TEXT_COLOR_NORMAL, RL.ColorToInt( RL.RED ) }, + properties = { + { RL.DEFAULT, RL.TEXT_COLOR_NORMAL, RL.ColorToInt( RL.RED ) }, + }, + texture = { texture = texture, rect = textureRect }, } ) - windowbox.texture = texture - windowbox.textureRect = textureRect local groupbox = Gui:GroupBox( Rect:new( 400, 700, 256, 256 ), @@ -206,9 +209,11 @@ function RL.init() function( self ) Gui:set2Top( self ) end, nil, { - { RL.DEFAULT, RL.TEXT_COLOR_NORMAL, RL.ColorToInt( RL.MAGENTA ) }, - { RL.DEFAULT, RL.TEXT_ALIGNMENT, RL.TEXT_ALIGN_CENTER }, - { RL.DEFAULT, RL.BACKGROUND_COLOR, RL.ColorToInt( RL.DARKBLUE ) }, + properties = { + { RL.DEFAULT, RL.TEXT_COLOR_NORMAL, RL.ColorToInt( RL.MAGENTA ) }, + { RL.DEFAULT, RL.TEXT_ALIGNMENT, RL.TEXT_ALIGN_CENTER }, + { RL.DEFAULT, RL.BACKGROUND_COLOR, RL.ColorToInt( RL.DARKBLUE ) }, + } } ) tabBar = Gui:GuiTabBar( @@ -243,13 +248,14 @@ function RL.init() 0, function( self ) print( self:getItem( self.active ) ) end, { - { RL.DEFAULT, RL.TEXT_COLOR_NORMAL, RL.ColorToInt( RL.RED ) }, - { RL.DEFAULT, RL.TEXT_COLOR_FOCUSED, RL.ColorToInt( RL.ORANGE ) }, - { RL.DEFAULT, RL.TEXT_COLOR_PRESSED, RL.ColorToInt( RL.GREEN ) }, + properties = { + { RL.DEFAULT, RL.TEXT_COLOR_NORMAL, RL.ColorToInt( RL.RED ) }, + { RL.DEFAULT, RL.TEXT_COLOR_FOCUSED, RL.ColorToInt( RL.ORANGE ) }, + { RL.DEFAULT, RL.TEXT_COLOR_PRESSED, RL.ColorToInt( RL.GREEN ) }, + }, + texture = { texture = texture, rect = textureRect }, } ) - listviewex.texture = texture - listviewex.textureRect = textureRect local messagebox = Gui:MessageBox( Rect:new( 1100, 150, 300, 128 ), "Title", |
