Geyser and setClickCallback()

Post Reply
Jarl
Posts: 5
Joined: Fri Jan 07, 2011 7:53 am

Geyser and setClickCallback()

Post 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

User avatar
Vadi
Posts: 4854
Joined: Sat Mar 14, 2009 3:13 pm

Re: Geyser and setClickCallback()

Post by Vadi »

Yep that looks about right according to the docs.

Post Reply