Touch Control
Posted: Thu Feb 20, 2014 2:48 pm
Hi.
I want Control the Player in xVelocity by click on the screen and move it (-x,+x).
I made it according to Draw Function. but there is a Problem that when I click on the screen, the Player move to click point like adventure games. Now I don't wan't this. I wan't when Click on the screen and move mouse, the Player move only at X coordinate and when release Mouse Button stop the Player at last Position.
first,I made a canvas actor on the screen and added this codes.
Create Actor >> Script Editor:
Mouse Button Down (Left) >> Script Editor:
Mouse Button Up (Left) >> Script Editor:
Draw Actor >> Script Editor:
"Mouse Position": Relative to point (xmouse,ymouse). I think one Problem is Related "Mouse Position" because have xmouse and ymouse, While I need only xmouse.
Please Guide Me to Solve this Problem.
Thanks A LOT
I want Control the Player in xVelocity by click on the screen and move it (-x,+x).
I made it according to Draw Function. but there is a Problem that when I click on the screen, the Player move to click point like adventure games. Now I don't wan't this. I wan't when Click on the screen and move mouse, the Player move only at X coordinate and when release Mouse Button stop the Player at last Position.
first,I made a canvas actor on the screen and added this codes.
Create Actor >> Script Editor:
- Code: Select all
draw = 0;
Mouse Button Down (Left) >> Script Editor:
- Code: Select all
screen_to_actor (&xmouse, 0);
actor_to_screen (&xmouse, 0);
draw = 1;
Mouse Button Up (Left) >> Script Editor:
- Code: Select all
draw = 0;
Draw Actor >> Script Editor:
- Code: Select all
if (draw == 1)
{
MoveTo("Player", 0, 0, 3, "Mouse Position", "");
}
"Mouse Position": Relative to point (xmouse,ymouse). I think one Problem is Related "Mouse Position" because have xmouse and ymouse, While I need only xmouse.
Please Guide Me to Solve this Problem.
Thanks A LOT