Getting started: TexturePacker and Corona SDK

TexturePacker and CoronaSDK 20 seconds to your optimized image sheet
twitter image ron gilbert @grumpygamer

Integrating the excellent TexturePacker into my build pipeline has saved me countless hours! Not sure how I lived without it.

Ron Gilbert / Double Fine Productions - creator of MonkeyIsland, The Cave, Broken Age and Thimbleweed Park

This overview shows you how to create your first image sheet and import it into your Corona SDK project.

These easy steps will cost you only 5 minutes - but make your development much easier. Promised!

Open TexturePacker, select Corona SDK (image sheet) as framework.

TexturePacker: Select Corona SDK (image sheet) as framework

Add sprites ...

Drag & drop sprites
onto TexturePacker.

... or folders

TexturePacker adds
all sprites inside the folder
and updates the texture
when the content changes.

Add Sprites to TexturePacker

Set output files
Make sure to set the output path of both files so that the images can be reached from your project.

Set the output path for your files

Click Publish sprite sheet to write the sprite sheet to your Corona SDK project.

TexturePacker: Click Publish sprite sheet


Load the image sheet information file created with TexturePacker into memory.

local sheetInfo = require("spritesheet")


Load the created image file.

local myImageSheet = graphics.newImageSheet
    ( "spritesheet.png", sheetInfo:getSheet() )

Create images

getFrameIndex allows you to access the sprites by their name.

display.newImage( myImageSheet , sheetInfo:getFrameIndex("spritename"))

Create animations

Use getFrameIndex to retrieve the index of the first frame.

local sequenceData = {
    name="walk",                                  -- name of the animation
    sheet=myImageSheet,                           -- the image sheet
    start=sheetInfo:getFrameIndex("capguy/0001"), -- first frame
    count=8,                                      -- number of frames
    time=1000,                                    -- speed
    loopCount=0                                   -- repeat

-- create sprite, set animation, play
sprite = display.newSprite( myImageSheet, sequenceData )

Do you want to read more?

Head over to our Corona SDK tutorials section.

Do you have any feedback or questions?

By clicking 'Submit' you agree that the data entered above is sent to and stored by CodeAndWeb GmbH for the purpose of answering your request. The data is transmitted through an encrypted internet connection and processed according to our privacy policy. You can withdraw your consent at any time with effect for the future.