|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mt4j.sceneManagement.AbstractScene
public abstract class AbstractScene
A class representing a scene in a program or game. It has its own main canvas and global input processors.
Constructor Summary | |
---|---|
AbstractScene(MTApplication mtApplication, java.lang.String name) The Constructor. |
Method Summary | |
---|---|
protected void |
clear(processing.core.PGraphics graphics) |
boolean |
destroy() Destroys the scene. |
void |
drawAndUpdate(processing.core.PGraphics graphics, long timeDelta) Draw and update. |
MTCanvas |
getCanvas() Gets the main canvas. |
MTColor |
getClearColor() Gets the clear color. |
AbstractGlobalInputProcessor[] |
getGlobalInputProcessors() Gets the global input processors. |
MTApplication |
getMTApplication() Gets the MT application instance. |
java.lang.String |
getName() Gets the name of the scene. |
Icamera |
getSceneCam() Gets the scene cam. |
ITransition |
getTransition() Gets the transition. |
abstract void |
init() Is invoked on a scene just before it is set to be the currently active scene. |
boolean |
isClear() Checks if the scene is being cleared each frame. |
protected void |
registerDefaultGlobalInputProcessors() Register default global input processors. |
void |
registerGlobalInputProcessor(AbstractGlobalInputProcessor processor) Registers a global input processor with the current scene. |
void |
registerPreDrawAction(IPreDrawAction action) Registers an action to be processed before the next frame in the main drawing thread. |
void |
setClear(boolean clearScreen) Sets the scene to be cleared each frame or not. |
void |
setClearColor(MTColor clearColor) Sets the clear color to use when the screen is cleared each frame before drawing. |
void |
setName(java.lang.String name) Sets the name. |
void |
setSceneCam(Icamera sceneCam) Sets the scene cam. |
void |
setTransition(ITransition transition) Sets the transition effect to use when a scene change takes place from this scene to another scene. |
abstract void |
shutDown() Gets called on the current scene just before the current scene gets changed to another scene. |
void |
unregisterGlobalInputProcessor(AbstractGlobalInputProcessor processor) Unregisters a global input processor. |
void |
unregisterPreDrawAction(IPreDrawAction action) Unregisters an PreDrawAction. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractScene(MTApplication mtApplication, java.lang.String name)
mtApplication
- the mt applicationname
- the nameMethod Detail |
---|
protected void registerDefaultGlobalInputProcessors()
public abstract void init()
init
in interface Iscene
public void drawAndUpdate(processing.core.PGraphics graphics, long timeDelta)
Iscene
drawAndUpdate
in interface Iscene
timeDelta
- the time deltaprotected void clear(processing.core.PGraphics graphics)
public abstract void shutDown()
shutDown
in interface Iscene
public void setClearColor(MTColor clearColor)
clearColor
- the new clear colorpublic MTColor getClearColor()
public void setClear(boolean clearScreen)
clearScreen
- the new clearpublic boolean isClear()
public MTCanvas getCanvas()
Iscene
getCanvas
in interface Iscene
public Icamera getSceneCam()
Iscene
getSceneCam
in interface Iscene
public void setSceneCam(Icamera sceneCam)
sceneCam
- the scene campublic MTApplication getMTApplication()
public java.lang.String getName()
Iscene
getName
in interface Iscene
public void setName(java.lang.String name)
name
- the namepublic void registerGlobalInputProcessor(AbstractGlobalInputProcessor processor)
processor
- the processorpublic void unregisterGlobalInputProcessor(AbstractGlobalInputProcessor processor)
processor
- the processorpublic AbstractGlobalInputProcessor[] getGlobalInputProcessors()
public void registerPreDrawAction(IPreDrawAction action)
registerPreDrawAction
in interface Iscene
action
- the actionpublic void unregisterPreDrawAction(IPreDrawAction action)
action
- the actionpublic ITransition getTransition()
Iscene
getTransition
in interface Iscene
public void setTransition(ITransition transition)
transition
- the new transitionpublic boolean destroy()
destroy
in interface Iscene
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |