Overview
GameView is the main rendering view of RareEngine2. It handles rendering the current scene, processing touch input, and running the main game loop. It extends SurfaceView and uses a HandlerThread for managing frame updates.
Field Summary
boolean paused
Indicates if the game loop is currently paused.
Handler h
Handler used for scheduling the game loop updates.
long frames
Frame counter, tracks how many frames have passed.
HandlerThread thread
Thread running the rendering loop.
Scene currentScene
Current active scene rendered by the engine.
ArrayList<String> layers
Rendering order of layers like "background", "objects", "ui".
Paint paint
Paint object used for rendering watermark and debug info.
Vector2 touchdist
Touch distance vector (unused currently).
int touchmilli
Touch millisecond tracker (unused currently).
Constant Summary
String REMOVE_WATERMARK_PASS
Password to remove RareEngine2 watermark: "-watermark".
Method Summary
void pause()
Pauses the rendering and game update loop.
void resume()
Resumes the rendering and game update loop.
boolean onTouchEvent(MotionEvent e)
Handles user touch input and dispatches it to the current scene.
void setScene(Scene scene)
Sets the current scene to be rendered and updated.
Scene getCurrentScene()
Returns the current active scene.