drag sprites

Discussion in 'Questions (Windows Mobile)' started by cpc6128, Mar 5, 2008.

  1. cpc6128

    cpc6128 Member Licensed User

    I was wondering whether it was possible to code a situation where Sprites could be dragged around the screen with the stylus (at run-time)? There only seems to be a 'click' event for Sprites rather than 'mouse down'. I thought it might be possible to use the 'mouse down' event of the Form, but this is blocked by the GameWindow object.
    The alternative to using Sprites is to draw the images directly onto the Form (and then use the Form's 'mouse down' event) but as this will be a lot more complicated than using the Sprite Library I thought I'd ask first!
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Another solution will be to use the NoCollisionMouse event and when the user taps on the screen the sprite will move (immediately or with a certain speed) to this point.
     
  3. cpc6128

    cpc6128 Member Licensed User

    Thanks for your reply Erel, I appreciate that would have the same end result but it is not the effect I am after! I am however making progress in coding the routine without using the Sprite Library.
     
  4. basepocket

    basepocket Member Licensed User

    Hi cpc6128,
    Did you manage to sort it out ? I'm currently looking for a way to do the same thing but can't find the solution... Clicking a sprite is easy, but is there a way to drag it ? Sprites have no MouseDown, MouseMove or MouseUp events...
     
  5. ChrisOrton

    ChrisOrton Member Licensed User

  6. eww245

    eww245 Member Licensed User

    A work around for this would be to make a smaller game window, use a panel with mousemove, and put it just outside the starting point of the sprite. Then put the panel to the outside of the ending point, after the sprite has moved.
    if the sprite is small the user may not notice that they are not actually clicking the sprite.
     
    Last edited: Mar 2, 2009
Loading...