We are currently developing a RPG with Android using a Renderer and Canvas.
Our “Main” method is a Surfaceview where we call different stuff like the Map, Monsters and at least the Character. All of them are Drawable and have a thread where they can change their pixel Position if they need to move to the next Block at the MapArray. This means our Map is devided in Squares and if they move they got a thread with a sleep which changes its Pixel Position. If the render draws them, it get draw at the pixel position not at the MapArray position. (The render is in ouar surfaceview the renderloop got its own class)
The render draws first the Map (background scaled to the Viewsize), char + skill if used, monsters and at least the Interface.
At the Moment the surfaceview doesn’t have a XML layout and i am bit confused if we need it one? At the moment it’s the surface is called from the Mainactivity by a Startbutton
The next question is, how to i realize the touchevents. Do i really need to get the event in the surfaceview check if its at the right square and call the function by squere?
or is there a way to draw a the joypad (Bitmap maybe lateron a Sprite) and make it touchable or something like that?
Does it automatically support multitouch? (Moving and using a skill at the same time)
Is there something we just did really wrong in the basic idear and implementation? (if you need some Code let me know)
Best Regards
Ben
SurfaceViewon screen and if your game rendering is done in it.onTouchEvent()method) and check the coordinates to decide what to do with it.