开发者

OpenGL ES iPhone Textures

For one of my new games I'm using OpenGL ES since it has multiple enemies and bullets, etc. H开发者_开发知识库ow do you draw images on the screen with Opengl ES? I have a player.png image that is a 48x48 pixel image; how would I draw that on the screen?


The basic answer is that you create a quad out of two triangles and draw that "camera facing" or in 2D mode on the screen.

In the iPhone example of OpenGL ES (the rocket ship one) you can see the Texture2D class which handles loading png's and displaying them. It's simple, but works.

But I would suggest you take a look at cocos2d iPhone. This framework handles a lot of this stuff for you and lets you focus a lot more on your game: http://code.google.com/p/cocos2d-iphone/

You might also look at GameSalad for a non-programmery way of making simple iPhone games: http://gamesalad.com/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜