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

  1. Object
  2. 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

pixels double
the amplitude
seconds double
the duration

Returns

this reaction

flash

public Feedback.Reaction flash(int argb, double seconds)
Flashes the screen.

Parameters

argb int
the color; its alpha is the strongest opacity
seconds double
the fade time

Returns

this reaction

sound

public Feedback.Reaction sound(String name)
Plays a sound.

Parameters

name String
passed to the Sink

Returns

this reaction

particles

public Feedback.Reaction particles(int count, int argb)
Bursts particles.

Parameters

count int
how many
argb int
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