Class Effects

java.lang.Object
nl.colorize.multimedialib.scene.effect.Effects

public final class Effects extends Object
Utility methods for creating effects that can be attached to the currently active scene as sub-scenes.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Scene
    appearText(Text text, float duration)
    Makes text slowly appear over time, with more and more characters appearing on screen over time until the entire text is shown.
    static Scene
    Changes a sprite's scale so that it fits the canvas.
    static Scene
    spin(Sprite graphic, float duration)
    Makes graphics rotate 360 degrees within the specified duration, with a shorter duration meaning a faster rotation speed.

    Methods inherited from class Object

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

    • scaleToFit

      public static Scene scaleToFit(Sprite sprite)
      Changes a sprite's scale so that it fits the canvas. This method uses uniform scaling, i.e. the sprite's original aspect ratio will be retained.

      This method returns a Scene that should be registered as a sub-scene. This is because the sprite needs to be rescaled every frame, as the sprite's graphics might change over time.

    • appearText

      public static Scene appearText(Text text, float duration)
      Makes text slowly appear over time, with more and more characters appearing on screen over time until the entire text is shown.
    • spin

      public static Scene spin(Sprite graphic, float duration)
      Makes graphics rotate 360 degrees within the specified duration, with a shorter duration meaning a faster rotation speed.