Results 1 to 5 of 5

Thread: OnClick how ?

  1. #1

    OnClick how ?

    hi , i draw one picture on the screen

    Code:
    ImageList.Items[0].Draw(DXDraw1.Surface,255,50,0);
    DXDraw1.Flip;
    But I can't find OnClick property.

  2. #2

    OnClick how ?

    the OnClick property for what?
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  3. #3

    OnClick how ?

    For the picture that i draw .

  4. #4

    OnClick how ?

    ImageLists and ImageList items DO NOT, have an OnClick event.
    TImage or TPaintBox have OnClick events.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  5. #5

    OnClick how ?

    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

    http://www.cerebral-bicycle.co.uk/viewdoc.asp?doc=38

    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •