I need to have a symbol ( containing image & text ) over the top of a background image. On tilting your mobile device it will move left or right only on the horizontal axis.

I would like full control over the speed it moves and how far left or right I can lock it to moving. I may also need to do some further versions where it moves vertically only. Is this possible using the physics engine in Hype 3?

They all have static properties in the Physics inspector and the rectangle in the middle has a Dynamic property (full physics body) and then with the “control gravity with device tilt” checked you can move the rectangle about only within the boundaries of the elements (therefore restricting movement to left and right only.

*note haven’t tested as don’t have mobile devices to hand

This will allow the user to increase/decrease speed based on the tilt. If you just want to move the object a specific speed then you can get the device orientation by Javascript and then set the element’s left property based on the value returned by the motion

If you want to control the speed and limit the distance without using Physics then (and this will only work in some browsers) then get the device’s orientation and move the element according to the gamma, beta or alpha data. Place this on scene load and give your element (symbol) and id.