Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Sprites Wont play on Phone
Started by geowah05 Mar 09 2015 06:22 PM

1 reply to this topic
corona sdk spritesheets not working on phone help graphics troubleshooting deug debug
[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

geowah05

[GLOBAL: userInfoPane.html]
geowah05
  • Observer

  • 1 posts
  • Corona SDK

local options =
{
    --required parameters
    width = 573,
    height = 637,
    numFrames = 8,
 
}
 
local sheet1 = graphics.newImageSheet( "enemy1.png", options )
 
local sequenceData =
{
    name="bird",
    start=1,
    count=8,
    time=300,
    loopCount = 0,   -- Optional ; default is 0 (loop indefinitely)
    loopDirection = "bounce"    -- Optional ; values include "forward" or "bounce"
}
 
 
local instance1 = display.newSprite( sheet1, sequenceData )
instance1.x = display.contentWidth / 2 
instance1.y = display.contentHeight / 2
instance1.xScale = .1
instance1.yScale = .1
instance1:play()
 
 
 
 
This code works on the simulator, but not on the phone. I keep getting this error message from the phone:
"  main.lua:23: bad argument #1 to 'newSprite' (ImageSheet expected, got nil)
 
 
please help

Attached Files



[TOPIC: post.html]
#2

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,585 posts
  • Corona SDK

Your filename is enemy1.PNG, but you refer to it as enemy1.png.

 

Case doesn't matter on the simulator, but is critical on the devices.

 

 

Note: I made a drop-in module to help you find these kinds of issues.  I describe it in this thread:

 

http://forums.coronalabs.com/topic/54382-any-chance-corona-could-check-upperlowercase-for-filenames-in-simulator/

 

 

-Ed




[topic_controls]
[/topic_controls]