Reader small image

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

Product typeBook
Published inMar 2015
Publisher
ISBN-139781783559343
Edition1st Edition
Tools
Right arrow
Author (1)
Michelle M Fernandez
Michelle M Fernandez
Right arrow

Images


Many art assets are used in Corona applications images. You will notice that bitmap image objects are a type of display objects.

Loading an image

Using display.newImage(filename [, baseDirectory] [, left, top]), an image object is returned. The image data is loaded from a filename you specified for your image and looks in system.ResourceDirectory for that file. The acceptable types of image files that are supported are .png (PNG-24 or higher only) and .jpg files. Avoid high .jpg compression as it may take longer to load on a device. The.png files have better quality than the .jpg files and are used to display transparent images. The .jpg files do not save transparent images.

Image autoscaling

The default behavior of display.newImage() is to autoscale large images. This is to conserve texture memory. However, there are times when you do not want to have images autoscaled, and there is an optional Boolean flag in the parameter list to control this manually.

To override autoscaling and show...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Corona SDK Mobile Game Development: Beginner's Guide
Published in: Mar 2015Publisher: ISBN-13: 9781783559343

Author (1)