MultiRezer for Corona!
Are you a Corona user? If you’re a developer and want your applications to support both the iPhone 3G resolution (320×480) and also the iPhone 4 (640×960), don’t want high file sizes, don’t want to waste memory by downscaling on the phone, then MultiRezer is for you!
Using MultiRezer is as simple as 1 – 2 – 3!
- Create all your graphics in double the resolution of the 3G (if you want to create a background create it at 640×960) and name the file yourfilename@2x.png (you MUST include the @2x, it can also be any file extension, PNG is recommended though)
- Create (or edit) your config.lua file and include the following
application = { content = { width = 320, height = 480, scale = "zoomEven", imageSuffix = { ["@2x"] = 2, }, }, } - Now just drag and drop your double resolution images (you can drop as many as you’d like at a time) onto the application’s icon and watch the magic begin!
It’ll downscale the images and rename them to exclude @2x. Now once you load your game on an iPhone 4 you’ll get high res graphics, and if you load it on the 3G you’ll get small graphics at no expense to the CPU! Sure, you can do the same thing in Photoshop, but the reason I created this utility was to save time, and it’s saved a LOT of time!
Some additional notes:
- When loading images in Corona instead of using display.newImage() you’re going to use display.newImageRect() instead.
- When created your imageRect make sure to set the width/height to the small graphics width/height (so if the @2x file is 20×20 you’re going to create the imageRect as 10×10)
- ALWAYS create your graphics as an even number, odd numbers can’t get cut in half, and graphics can’t have half pixels!
If you have any questions, would like to request a feature, or just let me know how awesome it is; just leave a comment below!
Enjoy using MultiRezer!
NOTE: Download link for the beta MultiRezer has been removed! Download MultiRezer 1.0 from here.
Related Posts
This post is tagged: Application, Corona, Development, Engine, Game, Graphics, Images, Independance, iPhone, iPhone 3G, iPhone 4, Lua, Multiresolution, MultiRezer, Resolution, Utility
Pingback: Corona SDK Ecosystem « TechLedger
Pingback: Step 1: organizing the tools » Tennisbot 3k Development Blog