Spirte Size Unknown?

Bugs will be moved here once resolved.

Post » Sat Sep 28, 2013 1:53 pm

I'm not sure if this is a bug or a limitation of the engine.

Link to .capx file (required!):
https://www.dropbox.com/s/b0zhnt8z5h314zm/spriteWidth.capx

Steps to reproduce:
1. In a Repeat loop, create an Sprite not present on the layout.
2. Set the X or Y to Sprite.Width(or Height)*loopindex

Observed result:
All the Sprites are on top of each other

Expected result:
They should be spread, as it happens when there's already a Sprite on the layout.
    
B
7
S
2
G
2
Posts: 25
Reputation: 1,910

Post » Sat Sep 28, 2013 2:14 pm

Hi,

Create the sprite at design time to ensure the width is available for the engine; otherwise, try waiting until the next tick, when all created sprites are available for the engine.



Cheers,
GregCJK2013-09-28 14:14:54
B
18
S
3
G
3
Posts: 83
Reputation: 3,736

Post » Sat Sep 28, 2013 2:31 pm

Closing as not a bug. @CJK is right, you need an instance in the layout for it to work; if no instances exist, all the object's expressions return 0.
Scirra Founder
B
387
S
230
G
87
Posts: 24,249
Reputation: 192,240


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 11 guests