View Single Post
  #4  
Old 01-22-2003, 05:22 AM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
Re: onImage(filename,x,y)

Quote:
Originally posted by Kaimetsu
Returns true if the point you specified is on the image and false if it falls on one of the transparent regions. I guess there are multiple this could be implemented:

1) The coordinates are given relative to the top-left corner of the image so the image doesn't need to be shown to be checked.
2) Instead of 'filename', the function takes image index (as used in showimg) and subsequently interprets the x and y as level or screen coordinates (depending on the draw layer of the given image).

Good for inventory systems - I can check if the player clicked on the apple rather than just checking against its bounding box. It opens up a few possibilities (systems like Ultima's, for example) and refines others. Let me know if the description wasn't clear enough.
I'm all for it. Better than doing if (mousex in |a,b|....) {}. Thats kind of how triggeraction works if I'm not mistaken (your proposed idea)?
__________________
Reply With Quote