Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

How do you deal with these situations?
Started by soggybag May 25 2013 10:21 AM

3 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

soggybag

[GLOBAL: userInfoPane.html]
soggybag
  • Contributor

  • 256 posts
  • Corona SDK

I'm just starting with TexturePacker I had a few general questions. 

 

1) How do you handle sprite sequences? It seems that you can call up a sprite by name, I didn't see a system to pull up a set of frames. 

 

If I work with starting frame and count, it's hard to tell what the frame number if for a sprite. 

 

2) How do you deal with sprites of different sizes? They tend to shift around when then the sprites are different sizes. 

 

3) Once you've separated the sprite from the main window how do you put it back? 



[TOPIC: post.html]
#2

Supertapp

[GLOBAL: userInfoPane.html]
Supertapp
  • Contributor

  • 289 posts
  • Corona SDK

Maybe this answers part of your question?  From TP I export a Corona SDK image sheet then the code in my project looks something like this:

 

local sheetData = require ("mySheet")
local sheet = graphics.newImageSheet( "mySheet.png", sheetData:getSheet())

local sequenceData = 
{
{name="run", start=1, count=5, time=200, loopCount = 0}, 
{name="jump", start=6, count=2, time=200, loopCount = 1}, 
}

local sprite = display.newSprite( sheet, sequenceData)

sprite:setSequence("run") 
sprite:play()

You would have to look in the mySheet.lua to get the frame numbers and code them manually as far as I can gather. 

 

I deal with different size sprites my drawing an invisible (alpha 0) box around them, the maximum size of the biggest sprite to help keep them centered.  It depends on the size difference though I guess as to wether this is practical for you or not as the physics will use this box for it's collisions. 

 

The Texture packer tutorials are really bad!

 

Hope this helps :)



[TOPIC: post.html]
#3

Elliott

[GLOBAL: userInfoPane.html]
Elliott
  • Enthusiast

  • 52 posts
  • Corona SDK

I posted something similar on another thread but I've found it easier to use Level Director (www.retrofitproductions.com/level-director).

 

You can import texturepacker & physicseditor files then create and view animation sequences.

It does all the hard work for you and exports a lua file with all the data in it (I use the template export option). 



[TOPIC: post.html]
#4

soggybag

[GLOBAL: userInfoPane.html]
soggybag
  • Contributor

  • 256 posts
  • Corona SDK

Thanks for the reply. Level Director looks pretty cool, sadly I am using a Mac and can not use it. 

 

I'm curious about this the Template Export System. I'd like to learn more about this.




[topic_controls]
[/topic_controls]