简体   繁体   中英

2D Drawing in Android

If you were to make a simple game, lets say a stick figure that you can move back and forward across a screen, would you need to use OpenGL in Android or would the 2D graphics that don't use OpenGL be enough? I'm thinking about attempting to make a simple game, but trying to see if it is necessary to focus on OpenGL. Thanks

Do you want a big suggestion?

Start learning and using AndEngine it's a Free Android 2D OpenGL Game Engine

This is a List of Apps and Games made with AndEngine and this is a list of showcases .

Also it's very very very cool because of it's extension (box2d, multiplayer, controls, and so on). Its founder now work in Zynga :)

Source code is avaible on GitHub (don't look on google code, it's outdated)

UPDATE: this is the full list of extensions

  • AndEngineAugmentedRealityExtension
  • AndEngineLiveWallpaperExtension
  • AndEngineMODPlayerExtension
  • AndEngineMultiplayerExtension
  • AndEngineMultiTouchExtension (Merged into the 'GLES2' branch.)
  • AndEnginePhysicsBox2DExtension
  • AndEngineSVGTextureRegionExtension
  • AndEngineTexturePackerExtension
  • AndEngineTMXTiledMapExtension (Merged into the 'GLES1' branch.)

If you have no OpenGL experience, but do not want to use an existing game library, I would suggest getting started with canvas. http://developer.android.com/guide/topics/graphics/2d-graphics.html

Check out the 'on a surface view' section for most relevant details. These days, this stuff is becoming more and more hardware accelerated, so you will see fairly decent performance on newer phones running 3.0 and above.

A great first project to read the source for and maybe use as a base is the classic 'Lunar Lander' Example.

http://developer.android.com/resources/samples/LunarLander/index.html

The best is to start with simple 2D animations until you learn how android works and then if you need more powerful graphics move to openGL. You may need some framework when you want to simulate gravity and physical collisions etc...

Check this first: How can I use the animation framework inside the canvas?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM