From 178196b0ffb8e2358ce9b0be5e1570a10136eb45 Mon Sep 17 00:00:00 2001 From: jussi Date: Wed, 21 Feb 2024 23:25:17 +0200 Subject: Raygui lib tooltip. --- examples/raygui_extensions/sprite_button.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'examples/raygui_extensions/sprite_button.lua') diff --git a/examples/raygui_extensions/sprite_button.lua b/examples/raygui_extensions/sprite_button.lua index 401c1a9..11bdf51 100644 --- a/examples/raygui_extensions/sprite_button.lua +++ b/examples/raygui_extensions/sprite_button.lua @@ -1,7 +1,7 @@ local SpriteButton = {} SpriteButton.__index = SpriteButton -function SpriteButton:new( bounds, text, texture, nPatchNormal, nPatchPressed, callback, styles ) +function SpriteButton:new( bounds, text, texture, nPatchNormal, nPatchPressed, callback, styles, tooltip ) local object = setmetatable( {}, self ) object._parent = nil @@ -12,6 +12,7 @@ function SpriteButton:new( bounds, text, texture, nPatchNormal, nPatchPressed, c object.nPatchPressed = nPatchPressed object.callback = callback object.styles = styles + object.tooltip = tooltip object.visible = true object.disabled = false @@ -20,6 +21,7 @@ function SpriteButton:new( bounds, text, texture, nPatchNormal, nPatchPressed, c end function SpriteButton:update() + -- print( self.tooltip ) return RL.CheckCollisionPointRec( RL.GetMousePosition(), self.bounds ) end @@ -43,8 +45,8 @@ function SpriteButton:setPosition( pos ) end function SpriteButton:register( gui ) - function gui:SpriteButton( bounds, text, texture, nPatchNormal, nPatchPressed, callback, styles ) - return self:addControl( SpriteButton:new( bounds, text, texture, nPatchNormal, nPatchPressed, callback, styles ) ) + function gui:SpriteButton( bounds, text, texture, nPatchNormal, nPatchPressed, callback, styles, tooltip ) + return self:addControl( SpriteButton:new( bounds, text, texture, nPatchNormal, nPatchPressed, callback, styles, tooltip ) ) end end -- cgit v1.2.3