public class MrRobottoEngine
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected Context |
mAndroidContext |
protected MrSceneTreeController |
mController |
protected MrSceneTree |
mSceneTree |
protected MrSurfaceView |
mSurfaceView |
protected static MrResources |
sResources |
Constructor and Description |
---|
MrRobottoEngine(Context androidContext,
MrSurfaceView surfaceView)
Creates a new MrRobotto Engine instance
|
Modifier and Type | Method and Description |
---|---|
MrEventDispatcher |
getEventDispatcher()
Gets the attached event dispatcher
|
MrObject |
getObject(java.lang.String name)
Searchs an object
|
static MrResources |
getResources()
Gets the resources used in scene loading time.
|
MrSceneTree |
getSceneTree()
Gets the current scene
|
MrSurfaceView |
getSurfaceView()
Gets the view where the engine is running
|
protected void |
initialize() |
MrSceneTree |
loadSceneTree(java.io.InputStream inputStream)
Loads a new scene from stream
|
void |
loadSceneTreeAsync(java.io.InputStream inputStream)
Loads the scene asynchronously
|
void |
onInitialize()
Once the scene is loaded and initialized this method is called.
|
void |
queueEvent(java.lang.Runnable runnable)
Queues a runnable to be executed on OpenGL Thread
|
void |
setEventDispatcher(MrEventDispatcher eventDispatcher)
Sets a new event dispatcher
|
void |
setFps(int fps)
Sets the maximum FPS the engine will run
|
protected static final MrResources sResources
protected MrSurfaceView mSurfaceView
protected Context mAndroidContext
protected MrSceneTreeController mController
protected MrSceneTree mSceneTree
public MrRobottoEngine(Context androidContext, MrSurfaceView surfaceView)
androidContext
- Android context attached to the engine.surfaceView
- Custom surface view used to render the scene.public static MrResources getResources()
public void setFps(int fps)
fps
- maximum FPSpublic MrSurfaceView getSurfaceView()
public MrSceneTree getSceneTree()
public MrObject getObject(java.lang.String name)
name
- name of objectpublic MrEventDispatcher getEventDispatcher()
public void setEventDispatcher(MrEventDispatcher eventDispatcher)
eventDispatcher
- new event dispatcher to be usedpublic MrSceneTree loadSceneTree(java.io.InputStream inputStream)
inputStream
- stream containing the scenepublic void loadSceneTreeAsync(java.io.InputStream inputStream)
inputStream
- stream containing the scenepublic void onInitialize()
protected final void initialize()
public void queueEvent(java.lang.Runnable runnable)
runnable
- code to be executed