Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public static final class Feedback.Reaction
- Object
- Feedback.Reaction
What one kind of event does.
Constructors
public Reaction() |
Methods
public Feedback.Reaction shake(double pixels, double seconds) | Shakes the camera. |
public Feedback.Reaction flash(int argb, double seconds) | Flashes the screen. |
public Feedback.Reaction sound(String name) | Plays a sound. |
public Feedback.Reaction particles(int count, int argb) | Bursts particles. |
public Feedback.Reaction playerOnly() | Limits the shake and flash to events about the player, so an enemy landing off screen does not rattle the camera. |
Inherited methods
Constructor details
Reaction
public Reaction()Method details
shake
public Feedback.Reaction shake(double pixels, double seconds)Shakes the camera.
Parameters
pixelsdouble- the amplitude
secondsdouble- the duration
Returns
this reaction
flash
public Feedback.Reaction flash(int argb, double seconds)Flashes the screen.
Parameters
argbint- the color; its alpha is the strongest opacity
secondsdouble- the fade time
Returns
this reaction
sound
public Feedback.Reaction sound(String name)Plays a sound.
Parameters
nameString- passed to the
Sink
Returns
this reaction
particles
public Feedback.Reaction particles(int count, int argb)Bursts particles.
Parameters
countint- how many
argbint- their color
Returns
this reaction
playerOnly
public Feedback.Reaction playerOnly()Limits the shake and flash to events about the player, so an enemy
landing off screen does not rattle the camera.
Returns
this reaction