diff options
| author | jussi | 2023-04-14 00:11:58 +0300 |
|---|---|---|
| committer | jussi | 2023-04-14 00:11:58 +0300 |
| commit | dc2edd69440fcc2470a45562149166695d4edbcc (patch) | |
| tree | 25d4779859468d44958f41357af53396452c3f52 /examples/resources/lib | |
| parent | 895c7f1a06de2d89347909d62da41be9d62f0d09 (diff) | |
| download | reilua-enhanced-dc2edd69440fcc2470a45562149166695d4edbcc.tar.gz reilua-enhanced-dc2edd69440fcc2470a45562149166695d4edbcc.tar.bz2 reilua-enhanced-dc2edd69440fcc2470a45562149166695d4edbcc.zip | |
Raygui wrapper lib.
Diffstat (limited to 'examples/resources/lib')
| -rw-r--r-- | examples/resources/lib/gui.lua | 12 | ||||
| -rw-r--r-- | examples/resources/lib/rectangle.lua | 2 | ||||
| -rw-r--r-- | examples/resources/lib/utillib.lua | 3 |
3 files changed, 11 insertions, 6 deletions
diff --git a/examples/resources/lib/gui.lua b/examples/resources/lib/gui.lua index 8335247..8bec529 100644 --- a/examples/resources/lib/gui.lua +++ b/examples/resources/lib/gui.lua @@ -1,4 +1,4 @@ -util = require( "utillib" ) +Util = require( "utillib" ) Rect = require( "rectangle" ) Vec2 = require( "vector2" ) Color = require( "color" ) @@ -106,11 +106,11 @@ function Gui.delete( cell ) end function Gui.set2Top( cell ) - util.tableMove( Gui._cells, Gui.getId( cell ), 1, #Gui._cells ) + Util.tableMove( Gui._cells, Gui.getId( cell ), 1, #Gui._cells ) end function Gui.set2Back( cell ) - util.tableMove( Gui._cells, Gui.getId( cell ), 1, 1 ) + Util.tableMove( Gui._cells, Gui.getId( cell ), 1, 1 ) end function Gui.process( mousePosition ) @@ -187,7 +187,7 @@ function Gui.process( mousePosition ) if 0 < key then if key == RL.KEY_BACKSPACE then - Gui._inputItem.text = util.utf8Sub( Gui._inputItem.text, 0, utf8.len( Gui._inputItem.text ) - 1 ) + Gui._inputItem.text = Util.utf8Sub( Gui._inputItem.text, 0, utf8.len( Gui._inputItem.text ) - 1 ) elseif key == RL.KEY_ENTER or key == RL.KEY_KP_ENTER then if Gui._inputItem.allowLineBreak then Gui._inputItem.text = Gui._inputItem.text.."\n" @@ -615,8 +615,8 @@ function Container:scroll( pos ) return end - self._scrollRect.x = util.clamp( pos.x, 0, self._scrollRect.width - self.bounds.width ) - self._scrollRect.y = util.clamp( pos.y, 0, self._scrollRect.height - self.bounds.height ) + self._scrollRect.x = Util.clamp( pos.x, 0, self._scrollRect.width - self.bounds.width ) + self._scrollRect.y = Util.clamp( pos.y, 0, self._scrollRect.height - self.bounds.height ) self:update() end diff --git a/examples/resources/lib/rectangle.lua b/examples/resources/lib/rectangle.lua index 2f9ad6c..3c0adf5 100644 --- a/examples/resources/lib/rectangle.lua +++ b/examples/resources/lib/rectangle.lua @@ -1,4 +1,6 @@ Rectangle = {} +-- Rectangle.TYPE = "Rectangle" + Rectangle.meta = { __index = Rectangle, __tostring = function( r ) diff --git a/examples/resources/lib/utillib.lua b/examples/resources/lib/utillib.lua index 3021465..920ebd7 100644 --- a/examples/resources/lib/utillib.lua +++ b/examples/resources/lib/utillib.lua @@ -114,6 +114,9 @@ function utillib.split( str, sep ) for str in string.gmatch( str, "([^"..sep.."]+)" ) do table.insert( t, str ) end + -- for s in string.gmatch( str, "([^"..sep.."]+)" ) do + -- table.insert( t, s ) + -- end return t end |
