Hello all I am trying to use a sprite sheet for some character animations. When I try to use it the console says it can't the lua file. I am a bit confused at how to get a spritesheet.lua from my spritesheet.png file I am using. I am extremely new to sprite sheets and any advise would be helpful.
Label: corona android iphone ipad building error inmobi problem display screen View image tableView failed object physics touch button game lua config event listener |
spritesheet.lua file (Where to get it?)
Hey crazypsycho, you need to require sprite to use it:
local sprite = require("sprite")
You might want to read this too, which describes how Sprite API works:
http://developer.anscamobile.com/reference/sprite-sheets
Naomi
Thank you Naomi, I did that. The specific error I am getting is...
no field package.preload['swim_sheet']
no file 'C:\Users\Chris\Desktop\NCG\code\swim_sheet.lua'
Hey crazypsycho, do you use any tool to generate spritesheets? I use Spriteloq, and it automatically generates a lua file that accompanies the png file. If you don't use any tool, I think you need to generate your own sprite sheet descriptor file. I could be wrong, but the quick look at the reference link seems to suggest the need for it. Did you read the reference link?
http://developer.anscamobile.com/reference/sprite-sheets
Naomi
I will have to check with my artist. I doubt he got that file when he created it though or he would of sent it with the spritesheet. Do you know of any free tools that will generate both files like that?
Crazypsycho, once I started using Spriteloq, I haven't look for any other. So, I don't know how other ones work...
Naomi
Crazy,
I would recommend using Zwoptex. What I always do is make a series of PNG's, then putting them into Zwoptex (it's free). Then I export the sprite sheet as a .png and then add this code:
1 2 3 4 5 6 7 8 9 10 11 12 13 | local loading = sprite.newSpriteSheet( "LoadingCircleOld.png", 102, 102 ) local spriteSet2 = sprite.newSpriteSet(loading, 1, 8) sprite.add( spriteSet2, "LD", 1, 8, 200, 0 ) local loadingSprite = sprite.newSprite( spriteSet2 ) loadingSprite.x = _W/2; loadingSprite.y = _H/1.15 loadingSprite.xScale = .7; loadingSprite.yScale = .7 loadingSprite.alpha = .5 loadingSprite:prepare("LD") loadingSprite:play() loadingSprite:pause() |
send message and call to a person
Forum: Report Spam + PM
[INSTALL_PARSE_FAILED_NO_CERTIFICATES]
[SOLVED] Director ERROR: Failed to execute new( params ) function on 'screen1'
Too many (200) local variables
Corona SVG Level Builder released. Drag and drop physics level editor with Inkscape and SVG.
Small bug in Collectible Items example
Pivot Joints and apparent elasticity
Can't make removeSelf() delayed
Game Center support?
Display Group scale not reflected in width/height
Displaying text on an object
Pixaquarium - My 1st Game App on iOS
How To Disable UI Button -- Please Help
Inmobi vs Inneractive
Why does an iOS Universal build give this error?
Mixing Multi Touch and Tab bar
Laser or plasma beam effect. How?