thai6070 Posted March 4, 2018 Share Posted March 4, 2018 (edited) My code (I saw from other post at forum and edited) Spoiler AddClassPostConstruct("widgets/statusdisplays", function(self) local rules = self:AddChild(ImageButton("images/scorebutton.xml", "scorebutton.tex")) local imgrules = self:AddChild(Image("images/rules.xml", "rules.tex")) rules:SetScale(0.5, 0.5, 0.5) rules:SetText("RULES") rules:SetOnClick(function() if imgrules.shown then imgrules:Hide() else imgrules:Show() end end) rules:SetPosition(-1000, 150, 0) imgrules:SetPosition(-600, -200, 0) rules:Show() imgrules:Hide() end) Am I wrong? I want to add show buttons like inspect self button, how should I choose widgets (statusdisplays or controls or inventorybar ...)? Thank you. scorebutton.xml scorebutton.tex Edited March 5, 2018 by thai6070 Link to comment https://forums.kleientertainment.com/forums/topic/88283-help-custom-button-does-not-show/ 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