Sprite

Hi everybody…

I’m using this sprite : http://iliketenerife.com/mosca_spr.png

And i have a system.getInfo(“maxTextureSize”)of 2048 on my Samsung Galaxy S1
I use the sprite of the alien (that is in the corona example) and that’s all ok… but if i use this sprite nothing appears!

 local pandaSheet = sprite.newSpriteSheet( "/media/mosca\_spr.png", 128, 128 )  
  
 local spriteset = sprite.newSpriteSet(pandaSheet, 1, 2)  
 sprite.add( spriteset, "set", 1, 2, 100, 0 )   
  
 local mosca = sprite.newSprite( spriteset )  
  
 mosca.x = -200; mosca.y = -100;  
 --mosca.xScale = 0.5; --mosca.yScale = 0.5;  
 mosca.myname = "mosca";  
  
 mosca:prepare("set")  
 mosca:play()  

and this is the code! If i use the sprite of the aliens (changing the number of frame of course) everything works ok!
P.s. In the emulator all it’s OK!!!
but in the mobil i only see the sprite with the alien…

i don’t know if i’m saving the .png in a bad way… Someone can i help me? [import]uid: 153233 topic_id: 27196 reply_id: 327196[/import]

I’m using the same code, but insted of create a new .png i used the alien.png i cropped to 256x256 i stick my picture… and everything is ok O.o

Corona, are you kidding me?!??

Someone can explain me? O.o [import]uid: 153233 topic_id: 27196 reply_id: 110427[/import]

Hi, first thing… In your declaration you are telling corona that the sprite is 128x128, the file you linked to is 256x256.

Also it appears you are initially placing the sprite offscreen? I presume you transition it onto the screen or something? [import]uid: 84637 topic_id: 27196 reply_id: 110429[/import]

local sheet2 = sprite.newSpriteSheet( "greenman.png", 128, 128 )  
  
local spriteSet2 = sprite.newSpriteSet(sheet2, 1, 15)  
sprite.add( spriteSet2, "man", 1, 15, 200, 0 ) -- play 15 frames every 200 ms  
  
local instance2 = sprite.newSprite( spriteSet2 )  
instance2.x = 3 \* display.contentWidth / 4 + 30  
instance2.y = baseline - 55  
  
instance2:prepare("man")  
instance2:play()  

This is a corona sample code…

And the greenman.png is of 512x512 … and here you are declaring 128x128 that is the size of the single frame of the sprite (not of all the sprite image)…
But i have solved the problem… It’s not guilty of firework :stuck_out_tongue: (I’m SORRY!!!)

The problem is this:

mosca.xScale = 0.5; mosca.yScale = 0.5;

If i use this, the sprite in my samsung galaxy disapper (or better no object created! because there are no animation and there are no EventListener attached to the image that i spawn)
Sorry for the inconveniencete and take a look of this property in the samsung galaxy s1 :slight_smile:
Have a nice day, and thank you for the soonest reply :slight_smile:

[import]uid: 153233 topic_id: 27196 reply_id: 110431[/import]

Indeed, sorry about that, early morning reply :slight_smile:

Glad you got it sorted ! [import]uid: 84637 topic_id: 27196 reply_id: 110433[/import]