Physics Events
Story Tellers iOS Starter Kit 2 Documentation
- ReverseGravity – will reverse whatever the gravity currently is in the scene. No value is needed. If the gravity was {2, 4} it will be {-2, -4}
- ReverseGravityOnX – will reverse whatever the gravity currently is, but only on the x axis
- ReverseGravityOnY – will reverse whatever the gravity currently is, but only on the y axis
- GravityOn – the value will be the Element to enable gravity. The Element should already have a physics body set.
- GravityOff – the value will be the Element to no longer be affected by gravity. The Element should already have a physics body set.
- GravityOnOrOff – the value will be the Element to toggle the effect of gravity on them
- DynamicOn – the value will be the Element to toggle the physics dynamic property on. Once on, it will be included in the scene’s physics simulations. The Element should already have a physics body set.
- DynamicOff – the value will be the Element to toggle the physics dynamic property off. The Element will be excluded from physics simulations but still retain it’s collision body. The Element should already have a physics body set.
- DynamicOnOrOff – will toggle the dynamic property on or off.
- RotationOn – will allow the physics body to rotate.
- RotationOff – will disable the physics body from rotating.
- RotationOnOrOff – will toggle whether or not the physics body is allowed to rotate.
- SetGravity – sets the world’s gravity in {x, y} format. In the example below, gravity is -2 on the y axis and gravity is 0 on the x axis (so no pull on x)
- ForceVector – when used as a TouchEvent set a String value for the force to apply to the Element touched. The vector is defined in {x, y} format. This can also be a Dictionary where each key name is the Element and the key value is the vector (see the image below).
- ImpulseVector – when used as a TouchEvent set a String value, for the vector impulse to apply to the Element touched. The vector is defined in {x, y} format. This can also be a Dictionary where each key name is the Element and the key value is the vector (see the image above).
- StopPhysics – You might notice when trying to stop a physics body from moving (for example, by disabling gravity or rotation) it still has “something” pushing it around. This is probably due to leftover forces and angular velocities still being applied. If that’s the case, use this property.
Detecting Collisions with Specific Objects
To read more about this visit the general properties page for Elements.