Package tripleplay.flump
Class MoviePlayer
java.lang.Object
tripleplay.flump.MoviePlayer
- All Implemented Interfaces:
AutoCloseable
,react.Closeable
A convenient controller to play though multiple different movies. Designed for characters and
objects that have a separate Flump symbol for each of their animations, and need to switch
between them.
-
Nested Class Summary
Nested classes/interfaces inherited from interface react.Closeable
react.Closeable.Set, react.Closeable.Util
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCreates anAnimation
that plays a one-shot movie.void
close()
layer()
The layer the movies are placed on.Shows a movie that loops forever.boolean
looping()
Whether the current movie is being looped.movie()
void
Drives this movie player with the supplied clock.Shows a movie that plays once.void
setLibrary
(Library lib) Sets the library all further movies we load will come from.
-
Field Details
-
movie
The currently playing movie, if any.
-
-
Constructor Details
-
MoviePlayer
-
MoviePlayer
-
-
Method Details
-
movie
-
setLibrary
Sets the library all further movies we load will come from. -
layer
The layer the movies are placed on. -
looping
public boolean looping()Whether the current movie is being looped. -
play
Shows a movie that plays once. When it completes, the last looping movie is returned to. It is an error to call this without starting a loop() first.- Parameters:
name
- The symbol name of the movie to play.restart
- If this movie is already being played, whether it will restart it from the beginning. Defaults to true.- Returns:
- This instance, for chaining.
-
play
-
loop
Shows a movie that loops forever.- Parameters:
name
- The symbol name of the movie to loop.restart
- If this movie is already being looped, whether it will restart it from the beginning. Defaults to true.- Returns:
- This instance, for chaining.
-
loop
-
animate
Creates anAnimation
that plays a one-shot movie. -
paint
Drives this movie player with the supplied clock. -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfacereact.Closeable
-