• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

OTClient Mouse Right Button

Helliot1

Owner of Empire Online
Joined
Jul 26, 2017
Messages
315
Solutions
1
Reaction score
58
Hello guys, I'm trying to create a function to set a text when I press right mouse in a button but I don't have any successful, somebody can help me?

I don't get any errors, and my function doesn't work

This is my function:
Lua:
spellsF1 = nil
spellsF1 = gameRootPanel:getChildById('spellsF1')

function openSpells()
  if spellsF1 and g_mouse.isPressed(MouseRightButton) then
    spellsF1:setText('Pressed')
  end
end

This is my button:
CSS:
  Button
    id: spellsF1
    size: 34 34
    !text: tr('F1')
    anchors.top: gameModPanel.top
    anchors.left: gameModPanel.left
 
Last edited:
Back
Top Bottom