Class AnimatedMascot
java.lang.Object
wiiuu.ui.AnimatedMascot
An animated branded card with speech bubbles, extracted from WII-UU: a card with
googly eyes and little legs. It walks in, blinks, watches a point (the selection), hops when it
has something to say, and says it in a speech bubble that types out and fades a few seconds
later. The host supplies messages, appearance, a clock, input and repaint scheduling.
Use one instance on one UI thread; it does not play audio.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordBranding and live appearance supplied by the host; font sizes are in points. -
Constructor Summary
ConstructorsConstructorDescriptionAnimatedMascot(Supplier<AnimatedMascot.Style> style, LongSupplier clock) Supply a live theme and a monotonic millisecond clock for deterministic animation.Use a fixed appearance and the system millisecond clock. -
Method Summary
Modifier and TypeMethodDescriptionbooleanhit(double x, double y) Whether a click at x, y hits it.voidhop()voidlook(float x, float y) Where it looks (screen coordinates).booleanWhether the next frame looks different (the caller repaints only then).voidpaint(Graphics2D g, float footX, float footY, float s, boolean bubbleAbove, float bubbleW) Paints it standing at footX, footY, with a body s high (2.6 s wide), and its bubble to the right (bubbleAbove false) or above it, at most bubbleW wide.voidpaintWalking(Graphics2D g, float footX, float footY, float s, float stride) longquietFor()How long since it last said something (ms).voidSays something (and hops).voidSays one of these, at random.booleantalking()
-
Constructor Details
-
AnimatedMascot
Use a fixed appearance and the system millisecond clock. Host owns repaint/input scheduling. -
AnimatedMascot
Supply a live theme and a monotonic millisecond clock for deterministic animation.
-
-
Method Details
-
say
Says something (and hops). -
sayOne
Says one of these, at random. -
quietFor
public long quietFor()How long since it last said something (ms). -
talking
public boolean talking() -
hop
public void hop() -
look
public void look(float x, float y) Where it looks (screen coordinates). -
hit
public boolean hit(double x, double y) Whether a click at x, y hits it. -
needsFrame
public boolean needsFrame()Whether the next frame looks different (the caller repaints only then). -
paint
public void paint(Graphics2D g, float footX, float footY, float s, boolean bubbleAbove, float bubbleW) Paints it standing at footX, footY, with a body s high (2.6 s wide), and its bubble to the right (bubbleAbove false) or above it, at most bubbleW wide. -
paintWalking
-