Welcome to the Achaea Forums! Please be sure to read the Forum Rules.

[Mudlet] Clickable Buttons

SenoskeSenoske Member Posts: 155 ✭✭✭ - Distinguished
edited December 2016 in Tech Support
Ok, so I'm trying to make an aff/def window on top of eachother. Using labels. So far I've gotten the first label to display but I don't seem to be able to get it to hide and switch with the other button when I click it. Where did I go wrong? Code:

function drawAffLabels()
affWindowLabel = Geyser.Label:new({
name = "affWindowShow",
x = 1, y = 1,
width = 75, height = 75,
bgColor = "black", fgColor = "white",
message = [[<center>Affs</center>]]
})
setLabelClickCallback("affWindowLabel")
end

function drawDefLabel()
defWindowLabel = Geyser.Label:new({
name = "defWindowHide",
x = 1+10, y = 1,
width = 10, height = 10,
bgColor = "black", fgColor = "white",
message = [[<center>Defs</center>]]
})
setLabelClickCallback("defWindowLabel")
end

function affWindowLabel()
affWindowLabel:hide()
defWindowLabel:show()
end

function defWindowLabel()
affWindowShow:show()
defWindowShow:hide()
end

Comments

  • JonathinJonathin A hole in the groundMember Posts: 2,962 @@ - Legendary Achaean
    Put your callback after the label you want to be able to click and then use this format

    labelName:setClickCallback("stuff")

    (Mudlet Clan): Nylian says, "Mosr's on the case. Fix incoming."

    Tutorials and scripts  The Repository

  • SenoskeSenoske Member Posts: 155 ✭✭✭ - Distinguished
    Woo got it! If anyone is wondering, and THANK YOU @Jonathin
     
    function drawAffLabel()
    affWindowLabel_1 = Geyser.Label:new({
    name = "affWindowShow",
    x = 1, y = 1,
    width = 75, height = 75,
    bgColor = "black", fgColor = "white",
    message = [[<center>Affs</center>]]
    })
    affWindowLabel_1:setClickCallback("affWindowLabel")
    end

    function drawDefLabel()
    defWindowLabel_1 = Geyser.Label:new({
    name = "defWindowHide",
    x = 1+75, y = 1,
    width = 75, height = 75,
    bgColor = "black", fgColor = "white",
    message = [[<center>Defs</center>]]
    })
    defWindowLabel_1:setClickCallback("defWindowLabel")
    end

    function affWindowLabel()
    affWindowLabel_1:hide()
    defWindowLabel_1:show()
    end

    function defWindowLabel()
    defWindowLabel_1:hide()
    affWindowLabel_1:show()
    end
     

    Jonathin
Sign In to Comment.