Jump to content

Recommended Posts

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 by thai6070

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
×
  • Create New...