Changed naming of gui functions set2Top and set2Back to setToTop and setToBack.

This commit is contained in:
jussi
2024-06-26 22:28:13 +03:00
parent c96306bcc3
commit e45564ea3f
15 changed files with 94 additions and 77 deletions

View File

@@ -95,11 +95,11 @@ function Gui.delete( cell )
end
end
function Gui.set2Top( cell )
function Gui.setToTop( cell )
Util.tableMove( Gui._cells, Gui.getId( cell ), 1, #Gui._cells )
end
function Gui.set2Back( cell )
function Gui.setToBack( cell )
Util.tableMove( Gui._cells, Gui.getId( cell ), 1, 1 )
end
@@ -518,12 +518,12 @@ function Element:delete()
Gui.delete( self )
end
function Element:set2Top()
Gui.set2Top( self )
function Element:setToTop()
Gui.setToTop( self )
end
function Element:set2Back()
Gui.set2Back( self )
function Element:setToBack()
Gui.setToBack( self )
end
-- Container.
@@ -820,34 +820,34 @@ function Container:clear()
self.cells = {}
end
function Container:set2Top()
Gui.set2Top( self )
function Container:setToTop()
Gui.setToTop( self )
for _, cell in ipairs( self.cells ) do
cell:set2Top()
cell:setToTop()
end
if self._VScrollbar ~= nil then
Gui.set2Top( self._VScrollbar )
Gui.setToTop( self._VScrollbar )
end
if self._HScrollbar ~= nil then
Gui.set2Top( self._HScrollbar )
Gui.setToTop( self._HScrollbar )
end
end
function Container:set2Back()
function Container:setToBack()
if self._VScrollbar ~= nil then
Gui.set2Back( self._VScrollbar )
Gui.setToBack( self._VScrollbar )
end
if self._HScrollbar ~= nil then
Gui.set2Back( self._HScrollbar )
Gui.setToBack( self._HScrollbar )
end
for _, cell in ipairs( self.cells ) do
cell:set2Back()
cell:setToBack()
end
Gui.set2Back( self )
Gui.setToBack( self )
end
function Container:draw()

View File

@@ -1922,11 +1922,10 @@ function Raygui:checkScrolling()
end
function Raygui:clickedInBounds( bounds )
print( self._mousePressPos, bounds )
return RL.CheckCollisionPointRec( self._mousePressPos, bounds )
end
function Raygui:set2Top( control )
function Raygui:setToTop( control )
for i, curControl in ipairs( self.controls ) do
if control == curControl then
Util.tableMove( self.controls, i, 1, #self.controls )
@@ -1936,7 +1935,7 @@ function Raygui:set2Top( control )
end
end
function Raygui:set2Back( control )
function Raygui:setToBack( control )
for i, curControl in ipairs( self.controls ) do
if control == curControl then
Util.tableMove( self.controls, i, 1, 1 )