Anyone using SpriteGrabber with a scale factor?

I am trying to use this, but I have problems with any scale factor other than 1:

local obj = display.newGroup();  
  
 local suffix = "";  
 local displayScale = display.contentScaleX;  
 print("scale: " .. displayScale)  
 if displayScale \< 1 then --this way it scales for iPad as well as iPhone  
 suffix = "@2x"  
 end  
   
local catSprites = spriteGrabber.grabSheet("catsprites"..suffix);  
 local cat = catSprites:grabSprite("",true,{run={1,8,1000,0}});  
 cat.x, cat.y = 0 , 0;  
 obj:insert(cat);  
 cat(0,0,displayScale,"c") --also tried "tl"  
 cat("run");  

If I manually set displayScale to 1, the animation plays fine. But if I let the simulator set it (which will give 0.46875 for the iPad), the sprite animation plays, but also bobs up and down while it’s animating. It stays in place if displayScale = 1. Why would this happen?

All of the images in the sprite sheet have the same spriteSourceSize. [import]uid: 52127 topic_id: 10938 reply_id: 310938[/import]

Do you get the same for:

[lua]local catSprites = spriteGrabber.grabSheet(“catsprites”…suffix);
local cat = catSprites:grabSprite("",true,{run={1,8,1000,0}});
obj:insert(cat);
cat:show(0,0,displayScale,“c”)
cat:playClip(“run”)[/lua]

?

You had omitted :show() and :playClip() functions in your code…
If you still have issues with this, plz upload a demo project somewhere (e.g. dropbox) so I can further help you. Make sure you include your config.lua file within the project zip.

Cheers

[import]uid: 7356 topic_id: 10938 reply_id: 39825[/import]

Yes, not sure why those got omitted when I posted, but they were there.

Anyway, I put the test project here:
http://www.megaupload.com/?d=AUZWYIF1

The animation shouldn’t bob up and down…

Thanks for trying to help. [import]uid: 52127 topic_id: 10938 reply_id: 39851[/import]

I am encountering some network problems, so I will take a look at the files tomorrow.

In the meantime, search the forum for “why the sprite library needs urgent debugging”. I have included a bug there that reminds me of what you are describing…

Sorry for the inconvenience.

***
http://developer.anscamobile.com/forum/2011/03/21/why-sprite-library-needs-urgent-debugging

Bug #1 [import]uid: 7356 topic_id: 10938 reply_id: 39860[/import]

@jn19

I am answering here, where the demo link is placed, just for future reference of other users.
First of all, your code (as is) runs properly only on ipad. You don’t give a spritesheet for displayScale==1

Now, to the point, you have faced bug #2 of the SDK “Sprite” library, which I have described here: http://developer.anscamobile.com/forum/2011/01/08/sprites-scaling-very-annoying-bug
For a temporary solution, rebuild your spritesheet selecting not to trim the images in TexturePacker/Zwoptex options.

Tell me if you still have issues with this.

Cheers

[import]uid: 7356 topic_id: 10938 reply_id: 40004[/import]

Thank you, using “Untrim” in Zwoptex fixes the problem, at least on this particular sprite. [import]uid: 52127 topic_id: 10938 reply_id: 40024[/import]