Ryan a2b7565639 Add 'multi/' from commit '285fa7e933d1986bcbd354294c05cee40ef43cea'
git-subtree-dir: multi
git-subtree-mainline: 14f186d8e1f36b38f6816dfa4d004dd023b882ce
git-subtree-split: 285fa7e933d1986bcbd354294c05cee40ef43cea
2017-07-28 11:08:11 -04:00

25 lines
684 B
Plaintext

function gui:newImageButton(i,name, x, y, w, h, sx ,sy ,sw ,sh)
x,y,w,h,sx,sy,sw,sh=filter(name, x, y, w, h, sx ,sy ,sw ,sh)
local c=self:newBase("ImageButton",name, x, y, w, h, sx ,sy ,sw ,sh)
if type(i)=="string" then
c.Image=love.graphics.newImage(i)
else
c.Image=i
end
c.Visibility=0
c.ImageVisibility=1
c.rotation=0
if c.Image~=nil then
c.ImageHeigth=c.Image:getHeight()
c.ImageHeight=c.Image:getHeight()
c.ImageWidth=c.Image:getWidth()
c.Quad=love.graphics.newQuad(0,0,w,h,c.ImageWidth,c.ImageHeigth)
end
c:OnEnter(function()
love.mouse.setCursor(_GuiPro.CursorH)
end)
c:OnExit(function()
love.mouse.setCursor(_GuiPro.CursorN)
end)
return c
end