Class CanvasOptions


  • public class CanvasOptions
    extends java.lang.Object
    A list of options that control the behavior of the canvas
    • Field Detail

      • autoAdd

        public boolean autoAdd
        Whether to automatically add Drawable's upon construction / instantiation.

        default: true

      • autoCenter

        public boolean autoCenter
        Whether to automatically center what's on screen whenever the screen is resized

        default: true

      • antiAlias

        public boolean antiAlias
        Whether to do antialiasing when drawing shapes

        default: true

      • backgroundColor

        public java.awt.Color backgroundColor
        The background color of the canvas

        default: Color.WHITE

      • fps

        public int fps
        The FPS to run rendering at

        default: 30

    • Constructor Detail

      • CanvasOptions

        public CanvasOptions()
    • Method Detail

      • isAutoAdd

        public boolean isAutoAdd()
        Returns:
        Weather Drawables are automatically added to the canvas upon construction
        See Also:
        autoAdd(boolean)
      • autoAdd

        public CanvasOptions autoAdd​(boolean autoAdd)
        Default: true
        Parameters:
        autoAdd - Whether to automatically add Drawable's upon construction / instantiation.
        Returns:
        This object for chaining
        See Also:
        isAutoAdd()
      • isAutoCenter

        public boolean isAutoCenter()
        Returns:
        Whether to automatically center what's on screen whenever the screen is resized
        See Also:
        autoCenter(boolean)
      • autoCenter

        public CanvasOptions autoCenter​(boolean autoCenter)
        Default: true
        Parameters:
        autoCenter - Whether to automatically center what's on screen whenever the screen is resized
        Returns:
        This object for chaining
        See Also:
        isAutoCenter()
      • isAntiAlias

        public boolean isAntiAlias()
        Returns:
        Whether to use antialiasing
        See Also:
        antiAlias(boolean)
      • antiAlias

        public CanvasOptions antiAlias​(boolean antiAlias)
        Default: true
        Parameters:
        antiAlias - Whether to use antialiasing
        Returns:
        This object for chaining
        See Also:
        isAntiAlias()
      • getBackgroundColor

        public java.awt.Color getBackgroundColor()
        Returns:
        The background color of the canvas
        See Also:
        backgroundColor(Color)
      • backgroundColor

        public CanvasOptions backgroundColor​(java.awt.Color backgroundColor)
        Default: Color.WHITE
        Parameters:
        backgroundColor - The background color of the canvas
        Returns:
        This object for chaining
        See Also:
        getBackgroundColor()