How to animate images using bitmaps / rgb data in iOS

后端 未结 2 1419
一个人的身影
一个人的身影 2021-01-17 05:21

I\'m programming a game on my iPhone, and I have an image I want to animate, say a walking person in a bitmap. The bitmap changes over time. How do I add the bitmaps to the

2条回答
  •  伪装坚强ぢ
    2021-01-17 06:14

    The most efficient way to load an image sequence is to use PVR-format images and load them as OpenGL textures. PVR images support a variety of formats, including raw 32-bit RGB data.

    I've wrapped up this functionality in a library that gives you a GLImageView and lets you specify a list of filenames which it will efficiently stream into memory and play in sequence:

    https://github.com/nicklockwood/GLView

    Check out the included example and see if it will work for your needs. The documentation includes instructions for creating the images in the right format, etc.

提交回复
热议问题