Main > Features > Configurable Texture Sets
With variety of supported display resolutions it can be useful
to create separate texture sets, for example:
- small textures for iPhone3 (480x320)
- large textures for iPhone4 (960x640) and iPad1/2 (1024x768)
- super large textures for iPad3 (2048x1536)
You can tell Tiny2D which texture set to use and what (fake) scale to
apply to it. This way an app can still think it is using texture
of the default size.
For example, imagine an app originally designed for iPhone3's 480x320
resolution. Now, we also want to run it on iPhone4 (960x640) but with
higher resolution textures. All we need to do is add these high-res
textures in directories next to default textures with an extra name
suffix (e.g. @2x, so e.g. default: sprite.png high-res: email@example.com)
and this is what we need to do during app startup:
outParams->textureVersionSizeMultiplier = 0.5f;
outParams->textureVersion = "@2x";
Tiny2D will automatically try to load textures with @2x suffix first.
If found, it will load it and report 'fake' dimensions i.e. dimensions
multiplied by 0.5f (so, half the actual size). And if the texture is not
found it will simply try to load normal texture.