Page 1 of 1

Geyser and setClickCallback()

Posted: Thu Mar 29, 2012 7:27 pm
by Jarl
Okay, so pardon if this is a stupid question. Everything I know is self-taught from examples/lua tutorials and the like..

I would like to create a ship compass that is clickable to turn my ship in a particular direction. I created the labels using Geyser like so (the actual label itself is shown, not the containers it is a part of)...
Code: [show] | [select all] lua
shipdir_n = Geyser.Label:new({
     name="shipDir n",
     },
     shipdir)  
shipdir_n:echo("n")
The Geyser works to show all the compass directions etc, but I would like to now make them clickable. I do not understand, nor can I find examples/directions for setClickCallback() as seen once in the nestable labels portion of the Manual:Geyser. (of course I just may not see it?? :( ) Essentially, I don't understand the method by which the setClickCallback() works... like so??
Code: [show] | [select all] lua
shipdir_n:setClickCallback("shipGoDir", "north")
function shipGoDir(dir)
    send("SHIP TURN "..dir)
end

Re: Geyser and setClickCallback()

Posted: Mon Feb 27, 2017 7:35 am
by Vadi
Yep that looks about right according to the docs.