Class Animated

    • Constructor Detail

      • Animated

        public Animated()
    • Method Detail

      • play

        public void play()
        Play / resume the animation
      • stop

        public void stop()
        Stop the animation and jump to beginning
      • pause

        public void pause()
        Pause the animation
      • onUpdate

        public void onUpdate()
        Description copied from class: GameObject
        This method gets called every frame before the render method. Here is place for the GameObject logic updates, e.g. input handling, physics, actions, ...
        Overrides:
        onUpdate in class GameObject
      • setAnimationSpeed

        public void setAnimationSpeed​(float animationSpeed)
        Setting the speed of the animation. (curFrame += frameTime * animationSpeed)
        Parameters:
        animationSpeed - New animation speed
      • getAnimations

        public Set<String> getAnimations()
        Returns:
        All available animations
      • onRender

        public void onRender()
        Description copied from class: GameObject
        In this method the GameObject gets rendered onto the screen (if it has an graphical representation). Its primary used for MasterRenderer calls.
        Overrides:
        onRender in class GameObject
      • setLoop

        public void setLoop​(boolean loop)
        Should the animation loop, when its over
        Parameters:
        loop - Should the animation loop, when its over
      • setCurrentTime

        public void setCurrentTime​(float currentTime)
        Setting the current time of the animation
        Parameters:
        currentTime - Current time of the animation
      • setAnimatedEntity

        public void setAnimatedEntity​(AnimatedEntity animatedEntity)
        Setting the entity, that should be animated. Unset the current set animation.
        Parameters:
        animatedEntity - Entity to animate
      • setAnimation

        public boolean setAnimation​(String animation)
        Setting the animation, that should be played. If the animation doesnt exist or the anmated entity isnt set, animation will not be setted and this method returns false. Pass null to unset animation
        Parameters:
        animation - Animation to play
        Returns:
        Animation not setted (Animation dont exist or animated entitiy isnt set)
      • getAnimatedEntity

        public AnimatedEntity getAnimatedEntity()
        Returns:
        Current set entity