diff options
Diffstat (limited to 'examples/raygui_extensions/tree_view.lua')
| -rw-r--r-- | examples/raygui_extensions/tree_view.lua | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/examples/raygui_extensions/tree_view.lua b/examples/raygui_extensions/tree_view.lua index 055694d..b15469c 100644 --- a/examples/raygui_extensions/tree_view.lua +++ b/examples/raygui_extensions/tree_view.lua @@ -20,8 +20,8 @@ function TreeView:new( bounds, text, callbacks, styles, tooltip ) object.bounds = bounds:clone() object.text = text - object.scroll = Vec2:new( 0, 0 ) - object.view = Rect:new( 0, 0, 0, 0 ) + object.scroll = Vector2:new( 0, 0 ) + object.view = Rectangle:new( 0, 0, 0, 0 ) object.callbacks = callbacks -- select, grab, drag. object.styles = styles object.tooltip = tooltip @@ -44,7 +44,7 @@ function TreeView:new( bounds, text, callbacks, styles, tooltip ) object.selectedItems = {} - object:setSize( Vec2:new( object.bounds.width, object.bounds.height ) ) + object:setSize( Vector2:new( object.bounds.width, object.bounds.height ) ) object._forceCheckScroll = false object._posY = 0 -- In control list update. @@ -61,7 +61,7 @@ function TreeView:new( bounds, text, callbacks, styles, tooltip ) end function TreeView:getDefaultBounds() - return Rect:new( self.padding, self.padding, self.defaultControlSize.x, self.defaultControlSize.y ) + return Rectangle:new( self.padding, self.padding, self.defaultControlSize.x, self.defaultControlSize.y ) end local function getControlBounds( control ) @@ -76,7 +76,7 @@ function TreeView:updateControl( control ) self._curId = self._curId + 1 if control.visible then - control:setPosition( Vec2:new( control.bounds.x, self._posY ) ) + control:setPosition( Vector2:new( control.bounds.x, self._posY ) ) local bounds = getControlBounds( control ) bounds.x = bounds.x + self._curDepth * self.indentation @@ -269,7 +269,7 @@ function TreeView:itemSelect( item ) end function TreeView:update() - local mousePos = Vec2:newT( RL.GetMousePosition() ) + local mousePos = Vector2:newT( RL.GetMousePosition() ) local guiMousePos = mousePos + self.gui.mouseOffset local mouseInView = self.view:checkCollisionPoint( mousePos ) @@ -360,7 +360,7 @@ function TreeView:draw() end function TreeView:updateMouseOffset() - self.gui.mouseOffset = Vec2:new( -self.view.x - self.scroll.x, -self.view.y - self.scroll.y ):scale( self.mouseScale ) + self.gui.mouseOffset = Vector2:new( -self.view.x - self.scroll.x, -self.view.y - self.scroll.y ):scale( self.mouseScale ) end function TreeView:setPosition( pos ) @@ -377,19 +377,19 @@ function TreeView:setSize( size ) local scrollBarWidth = RL.GuiGetStyle( RL.LISTVIEW, RL.SCROLLBAR_WIDTH ) local borderWidth = RL.GuiGetStyle( RL.DEFAULT, RL.BORDER_WIDTH ) - self.content = Rect:new( + self.content = Rectangle:new( 0, self.gui.RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT, self.bounds.width - scrollBarWidth - self.padding * 2 - borderWidth * 2, self.bounds.height - scrollBarWidth - self.padding * 2 - borderWidth * 2 ) - self.defaultControlSize = Vec2:new( self.content.width, self.defaultControlHeight ) + self.defaultControlSize = Vector2:new( self.content.width, self.defaultControlHeight ) local _, _, view = RL.GuiScrollPanel( self.bounds, self.text, self.content, self.scroll, self.view ) - self.view = Rect:newT( view ) + self.view = Rectangle:newT( view ) - self.gui.view = Rect:new( 0, 0, self.view.width, self.view.height ) - self.framebufferSize = Vec2:new( self.bounds.width, self.bounds.height - self.gui.RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT ) + self.gui.view = Rectangle:new( 0, 0, self.view.width, self.view.height ) + self.framebufferSize = Vector2:new( self.bounds.width, self.bounds.height - self.gui.RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT ) if self.framebuffer ~= nil and not RL.IsGCUnloadEnabled() then RL.UnloadRenderTexture( self.framebuffer ) |
