Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public final class Fx

  1. Object
  2. Fx
Effects: energy, magic, damage and sci-fi surfaces. Most glow through the EMISSIVE hook, so they pair well with PostProcess.setBloom. Those that fade out need an alpha blended or additive render state; each says so.

Fields

public static final String COLOR = "fxColor"VEC3 the effect’s main colour.
public static final String COLOR2 = "fxColor2"VEC3 its second colour: an edge, a core, a hot spot.
public static final String AMOUNT = "fxAmount"FLOAT progress or strength, 0 to 1: how dissolved, how charged.
public static final String SCALE = "fxScale"FLOAT pattern repeats per unit.
public static final String SPEED = "fxSpeed"FLOAT animation speed multiplier.
public static final String HIT = "fxHit"VEC4 a world point (xyz) and the time (w) it was hit, for ripples.

Methods

public static ShaderMaterial dissolve()Burns the surface away: pixels vanish as AMOUNT rises from 0 to 1, with a glowing COLOR edge ahead of the hole.
public static ShaderMaterial hologram()A hologram: scan lines climbing the surface, a bright rim, flicker and see-through body.
public static ShaderMaterial forceField()A force field bubble: a honeycomb that lights up at the silhouette and ripples out from the last hit (HIT).
public static ShaderMaterial beam()A beam or laser along the texture’s u: a white hot core, a coloured sheath and energy streaming along it.
public static ShaderMaterial fire()Flames on a camera facing quad: v runs from the base (0) to the tips (1).
public static ShaderMaterial smoke()Smoke puffs on a camera facing quad: soft billowing grey that thins toward the edges and drifts up.
public static ShaderMaterial portal()A swirling portal on a disc or quad centred on uv (0.5, 0.5): spiral arms pulled toward a bright rim and a dark centre.
public static ShaderMaterial xray()X-ray: only the silhouette glows, the body is invisible.
public static ShaderMaterial pulse()A damage flash and pulse: the surface keeps its look and glows COLOR by AMOUNT, throbbing.

Inherited methods

Field details

COLOR

public static final String COLOR = "fxColor"
VEC3 the effect’s main colour.

COLOR2

public static final String COLOR2 = "fxColor2"
VEC3 its second colour: an edge, a core, a hot spot.

AMOUNT

public static final String AMOUNT = "fxAmount"
FLOAT progress or strength, 0 to 1: how dissolved, how charged.

SCALE

public static final String SCALE = "fxScale"
FLOAT pattern repeats per unit.

SPEED

public static final String SPEED = "fxSpeed"
FLOAT animation speed multiplier.

HIT

public static final String HIT = "fxHit"
VEC4 a world point (xyz) and the time (w) it was hit, for ripples.

Method details

dissolve

public static ShaderMaterial dissolve()
Burns the surface away: pixels vanish as AMOUNT rises from 0 to 1, with a glowing COLOR edge ahead of the hole. Opaque.

Returns

a new shader material

hologram

public static ShaderMaterial hologram()
A hologram: scan lines climbing the surface, a bright rim, flicker and see-through body. Alpha blended.

Returns

a new shader material

forceField

public static ShaderMaterial forceField()
A force field bubble: a honeycomb that lights up at the silhouette and ripples out from the last hit (HIT). Additive or alpha blended.

Returns

a new shader material

beam

public static ShaderMaterial beam()
A beam or laser along the texture’s u: a white hot core, a coloured sheath and energy streaming along it. Additive, on a quad or a thin cylinder.

Returns

a new shader material

fire

public static ShaderMaterial fire()
Flames on a camera facing quad: v runs from the base (0) to the tips (1). Turbulence rises, the colour runs from COLOR2 (hot) to COLOR (cool) to nothing. Additive.

Returns

a new shader material

smoke

public static ShaderMaterial smoke()
Smoke puffs on a camera facing quad: soft billowing grey that thins toward the edges and drifts up. Alpha blended.

Returns

a new shader material

portal

public static ShaderMaterial portal()
A swirling portal on a disc or quad centred on uv (0.5, 0.5): spiral arms pulled toward a bright rim and a dark centre. Opaque.

Returns

a new shader material

xray

public static ShaderMaterial xray()
X-ray: only the silhouette glows, the body is invisible. Additive; draw it with depth testing off to see it through walls.

Returns

a new shader material

pulse

public static ShaderMaterial pulse()
A damage flash and pulse: the surface keeps its look and glows COLOR by AMOUNT, throbbing. Drive AMOUNT from 1 down to 0 after a hit, or hold it for a power-up. Opaque.

Returns

a new shader material