View Full Version : OnClick how ?

30-10-2006, 12:58 PM
hi , i draw one picture on the screen


But I can't find OnClick property.

30-10-2006, 12:59 PM
the OnClick property for what?

30-10-2006, 01:06 PM
For the picture that i draw .

30-10-2006, 01:27 PM
ImageLists and ImageList items DO NOT, have an OnClick event.
TImage or TPaintBox have OnClick events.

30-10-2006, 04:27 PM
You need to use a combination of
Form.DXDraw1MouseMove and ( Form.DXDraw1MouseDown or Form.DXDraw1MouseUp )

test your object to see if they are at the same point as the mouse and perform the relevant action.

I do something like this in my Demo Game Guns


I create a sprite which is the mouse pointer.
On the MouseMove I set my Cursor sprite position
On the MouseUp I see if the my menu options to see if they collided with the cursor in the DoCollision phase and depending on the menu options selected, I perform some action.

This is not the only or by any means the best way to do it, but it's one way.

In my current game I bind the address of a procedure to the object and when the Click is made, if it is assigned, the object calls the procedure itself.