Package view
Interface ViewIterator
public interface ViewIterator
This iterator is implemented by the derived EntityViews - such as, SpriteView etc.
By setting the active bit, the image can be frame-advanced for rendering purposes.
The objective of this interface is to support a visual representation of the active state of the EntityModel.
- Author:
- Krish Pillai
-
Method Details
-
setActive
void setActive(boolean active) Sets the iterator to rolling mode or frozen mode. When set to active, the frame advances from image to image to support animation. This state should be in sync with the active state of the EntityModel that aggregates this View.- Parameters:
active- The state of the iterator. When true, advances the frame.
-
isActive
boolean isActive()Returns the state of the iterator.- Returns:
- true or false.
-
next
BufferedImage next()Fetches the next drawable buffered image from the Sprite, Scenery, or Text based entity view.- Returns:
- The next image to be rendered on canvas, or the same image if the iterator is inactive.
-