Need Help... Issues with Sliding menu
![schwarzA](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
Hey Everyone!
Currently I made a sliding menu and it works perfect with a mouse press to slide my menu.
Its been made with a camera actor and a drag actor
(Both prototype actors have not been changed or modified in anyway, I've only changed the instances in the scene)
Heres what the drag actor instance is currently set at:
When Mouse button is down
Change attribute -
self.position.X to game.Mouse.Position.X
Constrain attribute -
self.Motion.Linear Velocity.X to 10*( game.Mouse.Position.X - self.Position.X )
Otherwise:
Constrain attribute -
self.Motion.Linear Velocity.X to self.Motion.Linear Velocity.X *0.95
-----------------------------------------------------------------------------
Now i want to change it to make it work for an iPhone/iPad.
So i changed the drag actor instance to...
When touch is pressed
Change attribute -
self.position.X to game.Touches.Touch 1.X
Constrain attribute -
self.Motion.Linear Velocity.X to 10*( game.Touches.Touch 1.X - self.Position.X )
Otherwise:
Constrain attribute -
self.Motion.Linear Velocity.X to self.Motion.Linear Velocity.X *0.95
(Thinking that would work)
My scene width is 2000 and height is 320 (Landscape menu)
I thought since now I would need to touch the screen to slide the menu, I made the drag instance the same height and width of my current scene.
It works for 1 swipe, then it will not move after that.
I then attempted to make the drag instance the same width as a scene that hasn't been changed (width of 480)
This causes the same issue.
If anyone could tell me what I'm doing wrong or have any advice it be greatly appreciated!
Thanks
Currently I made a sliding menu and it works perfect with a mouse press to slide my menu.
Its been made with a camera actor and a drag actor
(Both prototype actors have not been changed or modified in anyway, I've only changed the instances in the scene)
Heres what the drag actor instance is currently set at:
When Mouse button is down
Change attribute -
self.position.X to game.Mouse.Position.X
Constrain attribute -
self.Motion.Linear Velocity.X to 10*( game.Mouse.Position.X - self.Position.X )
Otherwise:
Constrain attribute -
self.Motion.Linear Velocity.X to self.Motion.Linear Velocity.X *0.95
-----------------------------------------------------------------------------
Now i want to change it to make it work for an iPhone/iPad.
So i changed the drag actor instance to...
When touch is pressed
Change attribute -
self.position.X to game.Touches.Touch 1.X
Constrain attribute -
self.Motion.Linear Velocity.X to 10*( game.Touches.Touch 1.X - self.Position.X )
Otherwise:
Constrain attribute -
self.Motion.Linear Velocity.X to self.Motion.Linear Velocity.X *0.95
(Thinking that would work)
My scene width is 2000 and height is 320 (Landscape menu)
I thought since now I would need to touch the screen to slide the menu, I made the drag instance the same height and width of my current scene.
It works for 1 swipe, then it will not move after that.
I then attempted to make the drag instance the same width as a scene that hasn't been changed (width of 480)
This causes the same issue.
If anyone could tell me what I'm doing wrong or have any advice it be greatly appreciated!
Thanks
![=) =)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smiley.png)