Jump to content

[HELP] Clickable Buttons


Recommended Posts

@DarkXero:

 

I tried to add another button with the help of the code you made but it gives an error like:

 

L4lXPG.png

 

What I'm doing wrong :/

Assets = {	Asset("ATLAS", "images/rules.xml"),	Asset("IMAGE", "images/rules.tex"),	Asset("ATLAS", "images/top.xml"),	Asset("IMAGE", "images/top.tex"),}local ImageButton = GLOBAL.require("widgets/imagebutton")local TopButton = GLOBAL.require("widgets/imagebutton")local Image = GLOBAL.require("widgets/image")local Top = GLOBAL.require("widgets/image")AddClassPostConstruct("widgets/statusdisplays", function(self)	local rules = self:AddChild(ImageButton())	local imgrules = self:AddChild(Image("images/rules.xml", "rules.tex"))	rules:SetScale(0.7, 0.7, 0.7)	rules:SetText("Kurallar")	rules:SetOnClick(function()		if imgrules.shown then			imgrules:Hide()		else			imgrules:Show()		end	end)	rules:SetPosition(-1460, 120, 0)	imgrules:SetPosition(-800, -200, 0)	rules:Show()	imgrules:Hide()end)AddClassPostConstruct("widgets/statusdisplays", function(self)	local top = self:AddChild(TopButton())	local imgtop = self:AddChild(Top("images/top.xml", "top.tex"))	top:SetScale(0.7, 0.7, 0.7)	top:SetText("TOP 10")	top:SetOnClick(function()		if imgtop.shown then			imgtop:Hide()		else			imgtop:Show()		end	end)	top:SetPosition(-1360, 120, 0)	imgtop:SetPosition(-800, -200, 0)	top:Show()	imgtop:Hide()end)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...