Class GameScreen

java.lang.Object
wiiuu.engine.GameScreen

public final class GameScreen extends Object
A game's picture as Choccy Milk draws it: as big as fits at the game's shape (or stretched to 16:9), whole source pixels or upscaled (smooth, Scale2x, Scale3x, xBR 2x / 4x, a CRT TV: look(String, boolean)), optionally with each frame blended into the one before, on black, with a hint at the top for a few seconds after it starts. Shared by WII-UU's menu and the Choccy Milk app; frames come in on the player's reading thread.

The heavier effects (xBR, CRT) run on all of this computer's cores. When a linked WII-UU runs the game (sharing the work), that's the work of the computer at the TV, which is idle otherwise.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Color
    The hint's color (WII-UU's warm "milk" brown).
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    announce(String title, String text, boolean trophy, long millis)
    Shows a card at the bottom for a while: a title, a line under it, with a trophy for achievements.
    boolean
    Whether a card is showing (keep repainting).
    void
    Forgets the picture (the game ended); the hint shows again for the next one.
    void
    frame(int[] rgb, int w, int h, float aspect)
    A frame in the first w * h pixels (0xRRGGBB); aspect 0 uses the pixel dimensions.
    boolean
    Whether the hint is still showing (keep repainting until it has faded).
    static PadButton
    key(int keyCode)
    The keyboard's game buttons: arrows, X = A, Z = B, S = X, A = Y, Q / W = L / R, E / R = ZL / ZR, Enter = Start (+), Space or Shift = Select (-).
    void
    look(String filter, boolean stretch)
    How the next game's picture is drawn (see wiiuu.core.ChoccyPicture): the filter, "+blend" after it to blend frames.
    void
    paint(Graphics2D g, int w, int h, String hint, Font font)
     
    The newest picture, or null.
    pictureBounds(int w, int h)
    Exact viewport used for drawing, also used to map standalone DS stylus clicks.
    boolean
    Whether a game picture is there (a game is playing).
    void
    starting(String message)
    Enter the game view before its first frame, so a slow native core cannot leave the menu visible.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • HINT

      public static final Color HINT
      The hint's color (WII-UU's warm "milk" brown).
  • Constructor Details

    • GameScreen

      public GameScreen()
  • Method Details

    • look

      public void look(String filter, boolean stretch)
      How the next game's picture is drawn (see wiiuu.core.ChoccyPicture): the filter, "+blend" after it to blend frames.
    • frame

      public void frame(int[] rgb, int w, int h, float aspect)
      A frame in the first w * h pixels (0xRRGGBB); aspect 0 uses the pixel dimensions.
    • showing

      public boolean showing()
      Whether a game picture is there (a game is playing).
    • starting

      public void starting(String message)
      Enter the game view before its first frame, so a slow native core cannot leave the menu visible.
    • picture

      public BufferedImage picture()
      The newest picture, or null.
    • clear

      public void clear()
      Forgets the picture (the game ended); the hint shows again for the next one.
    • pictureBounds

      public Rectangle pictureBounds(int w, int h)
      Exact viewport used for drawing, also used to map standalone DS stylus clicks.
    • paint

      public void paint(Graphics2D g, int w, int h, String hint, Font font)
    • announce

      public void announce(String title, String text, boolean trophy, long millis)
      Shows a card at the bottom for a while: a title, a line under it, with a trophy for achievements.
    • announcing

      public boolean announcing()
      Whether a card is showing (keep repainting).
    • hintShowing

      public boolean hintShowing()
      Whether the hint is still showing (keep repainting until it has faded).
    • key

      public static PadButton key(int keyCode)
      The keyboard's game buttons: arrows, X = A, Z = B, S = X, A = Y, Q / W = L / R, E / R = ZL / ZR, Enter = Start (+), Space or Shift = Select (-). Null for other keys.