Author Topic: How to use the new functions.  (Read 4089 times)

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
How to use the new functions.
« on: July 19, 2010, 10:44:10 PM »
OnAsteroidSelected(id)

This will be called every time an asteroid is selected, not clicked. It took me a while to realise that, so I'm telling you. By selected, I mean every time you click on an asteroid that isn't the one you are currently examining. As an example: You have a map with four 'roids, 0, 1, 2, 3. If you click on 1, this function will be called, and 'id' will be 1. Every time you type 'id' as a variable from now on until it is changed (inside this function? will check that), it will be 1. If you then click on 3, it will be called again, and 'id' will be three. If you doubleclick on 2, the function will be called THE FIRST TIME YOU CLICK, AND THAT TIME ONLY. 'id' will be 2. If you then click on 1, it will be called again, and 'id' will be 1, etc.

File attached: OnAsteriodSelected demo.lua
                   Every time OnAsteroidSelected() is called, a message box will display which asteroid was clicked, and also the number of times the function has been called.


OnMouseLeftClicked(x, y)


POSSIBLY COMING SOON

OnMouseRightClicked(x, y)

POSSIBLY COMING SOON
« Last Edit: July 19, 2010, 11:31:50 PM by Pilchard123 »

Alex

  • Administrator
  • Ent
  • *****
  • Thank You
  • -Given: 3
  • -Receive: 14
  • Posts: 1,035
Re: How to use the new functions.
« Reply #1 on: July 19, 2010, 11:24:35 PM »
I'll officially document these soon btw, so maybe make this thread about changes or improvements you'd like to see with this kind of thing.

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: How to use the new functions.
« Reply #2 on: July 19, 2010, 11:31:09 PM »
Nah, just get rid of the thread, unless you want me to carry it on and you can use it for documentation.