Jump to content

GUI Buttons Bugged


Jazz
 Share

Recommended Posts

Rounded buttons and the gradient don't work for me. Tried blank project, marble project, and my latest project.

 

Code used:

gui = GUI:Create(context)

gui:GetBase():SetScript("Scripts/GUI/Panel.lua")

 

local buttonPlay = Widget:Create(100,200,200,90,gui:GetBase())

buttonPlay:SetScript("Scripts/GUI/Button.lua")

buttonPlay:SetText("Play")

 

local buttonQuit = Widget:Create(100,300,200,90,gui:GetBase())

buttonQuit:SetScript("Scripts/GUI/Button.lua")

buttonQuit:SetText("Quit")

 

In Button.lua rounded rectangles only draw a few pixels in the top

left of the button. I had to change the command to the following to

get a rectangle. The gradient doesn't show in either case.

 

gui:DrawRect(pos.x,pos.y,sz.width,sz.height,0,scale*3)

to

gui:DrawRect(pos.x,pos.y,sz.width,sz.height,0,0)

 

gui:DrawRect(pos.x,pos.y,sz.width,sz.height,1,scale*3)

to

gui:DrawRect(pos.x,pos.y,sz.width,sz.height,1,0)

 

First pic is stock script and second is same but after hovering over the Play button. Notice the pixels top left of each word. Third and fourth are after the above change. The font only changes size in my project but I don't set the scale in any of my scripts... am I doing something wrong?

post-12583-0-69775900-1469643558_thumb.png

post-12583-0-31090800-1469643584_thumb.png

post-12583-0-85635200-1469643600_thumb.png

post-12583-0-63861000-1469643606_thumb.png

---

Scott

 

Using Windows 7 Ultimate 64 bit/Core I7-2700K @ 4312mhz/24G RAM/Nvidia GTX 1060

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...