CanTotu Posted August 27, 2015 Share Posted August 27, 2015 How can I add a button at the top left of screen that opens up a menu with black transparent background and lists the rules of server? Link to comment https://forums.kleientertainment.com/forums/topic/57411-help-clickable-buttons/ Share on other sites More sharing options...
DarkXero Posted August 27, 2015 Share Posted August 27, 2015 @CanTotu: Rules.zip Link to comment https://forums.kleientertainment.com/forums/topic/57411-help-clickable-buttons/#findComment-666958 Share on other sites More sharing options...
CanTotu Posted August 27, 2015 Author Share Posted August 27, 2015 @CanTotu: Thank you so much Link to comment https://forums.kleientertainment.com/forums/topic/57411-help-clickable-buttons/#findComment-666982 Share on other sites More sharing options...
CanTotu Posted August 28, 2015 Author Share Posted August 28, 2015 @DarkXero: I tried to add another button with the help of the code you made but it gives an error like: 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 https://forums.kleientertainment.com/forums/topic/57411-help-clickable-buttons/#findComment-667095 Share on other sites More sharing options...
DarkXero Posted August 28, 2015 Share Posted August 28, 2015 @CanTotu, did you change the atlas correctly?top.xml has top.tex in both texture and element? Link to comment https://forums.kleientertainment.com/forums/topic/57411-help-clickable-buttons/#findComment-667153 Share on other sites More sharing options...
CanTotu Posted August 28, 2015 Author Share Posted August 28, 2015 Element was what I forgot thank you! Link to comment https://forums.kleientertainment.com/forums/topic/57411-help-clickable-buttons/#findComment-667162 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now