Class AnimatedDrawable

    • Constructor Detail

      • AnimatedDrawable

        public AnimatedDrawable​(long tickStart,
                                double xStart,
                                double yStart,
                                long duration,
                                double xEnd,
                                double yEnd,
                                int z,
                                String textureHandle)
        Create a new animated Drawable.
        Parameters:
        tickStart - start tick
        xStart - start x coordinate
        yStart - start y coordinate
        duration - duration in ticks
        xEnd - end x coordinate
        yEnd - end y coordinate
        z - value
        textureHandle - the handle of the texture used for this drawable
    • Method Detail

      • setCurrentTick

        public void setCurrentTick​(long renderTick)
        Description copied from interface: Drawable
        Set the current render tick for animated drawables.
        Specified by:
        setCurrentTick in interface Drawable
        Parameters:
        renderTick - The current render tick
      • getX

        public double getX()
        Description copied from interface: Drawable
        Get the x coordinate of the drawable. The coordinate system is based on cells where fractionals denote positions between cells.
        Specified by:
        getX in interface Drawable
        Returns:
        returns the X position as a double
      • getY

        public double getY()
        Description copied from interface: Drawable
        Get the y coordinate of the drawable. The coordinate system is based on cells where fractionals denote positions between cells.
        Specified by:
        getY in interface Drawable
        Returns:
        returns the Y position as a double
      • getZ

        public int getZ()
        Description copied from interface: Drawable
        Get the z value of the drawable. The z value is used to decide the drawing order of Drawables in the same cell.
        Specified by:
        getZ in interface Drawable
        Returns:
        returns the Z position as a double
      • getTextureHandle

        public String getTextureHandle()
        Description copied from interface: Drawable
        Get the handle of the texture for this drawable. The texture must be registered in the TextureRegistry.
        Specified by:
        getTextureHandle in interface Drawable
        Returns:
        returns the texture handle as a String
      • isTilable

        public boolean isTilable()
        Description copied from interface: Drawable
        Return wether this Drawable can be drawn tiled if multiple are present in the same cell.
        Specified by:
        isTilable in interface Drawable
        Returns:
        true if the Drawable is tilable
      • isAnimated

        public boolean isAnimated()
        Description copied from interface: Drawable
        Return wether the Drawable is animated.
        Specified by:
        isAnimated in interface Drawable
        Returns:
        true iff any property (x, y, z) is animated
      • getxStart

        public double getxStart()
        Get's xStart
        Returns:
        xStart
      • getyStart

        public double getyStart()
        Get's yStart
        Returns:
        yStart
      • getxEnd

        public double getxEnd()
        Get's xEnd
        Returns:
        xEnd
      • getyEnd

        public double getyEnd()
        Get's yEnd
        Returns:
        yEnd
      • getTickStart

        public long getTickStart()
        Get's tickStart
        Returns:
        tickStart
      • getTickEnd

        public long getTickEnd()
        Get's tickEnd
        Returns:
        tickEnd
      • getDuration

        public long getDuration()
        Get's duration
        Returns:
        duration