Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Corona SDK Mobile Game Development: Beginner's Guide

You're reading from  Corona SDK Mobile Game Development: Beginner's Guide

Product type Book
Published in Mar 2015
Publisher
ISBN-13 9781783559343
Pages 372 pages
Edition 1st Edition
Languages
Author (1):
Michelle M Fernandez Michelle M Fernandez
Profile icon Michelle M Fernandez

Table of Contents (19) Chapters

Corona SDK Mobile Game Development Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Getting Started with Corona SDK Lua Crash Course and the Corona Framework Building Our First Game – Breakout Game Controls Animating Our Game Playing Sounds and Music Physics – Falling Objects Operation Composer Handling Multiple Devices and Networking Your Apps Optimizing, Testing, and Shipping Your Games Implementing In-App Purchases Pop Quiz Answers Index

Dynamic resolution images


Earlier, we touched base with dynamic image resolution. The iOS devices are a perfect example for this case. Corona has the capability to use base images (for devices on the 3GS and lower) and double-resolution images (for the iPhone 4 that has a retina display), all in the same project file. Any of your double-resolution images can be swapped to your high-end iOS device without having to alter your code. This will allow your build to work with older devices and lets you handle more complex multiscreen deployment cases. You will notice that dynamic image resolution works in conjunction with dynamic content scaling.

Using the line, display.newImageRect( [parentGroup,] filename [, baseDirectory] w, h), will call out your dynamic resolution images.

Here, w refers to the content width of the image and h refers to the content height of the image.

Here is an example:

myImage = display.newImageRect( "image.png", 128, 128 )

Remember that the two values represent the base image...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}