IID did not work in R108.2

Bugs will be moved here once resolved.

Post » Fri Nov 09, 2012 9:24 pm

There are some problems in IID of sprite in R108.2

Reproduced steps

1. Add global number: index
2. Add button in canvas, add sprite in canvas
3. Add text in canvas.
4. Add action in button onclick event:
    a. Create new sprite object with x = 100+ 25*index
    b. set text = sprite.IID.

Expectation:
    text.text automatically increase from 0 to number of sprite object - 1.
Fact:
    text.text always = 0

Actually this problem never appear in R95.
I hope this problem could be fixed as soon as possible.


So sorry about my English.   
B
11
S
2
Posts: 73
Reputation: 1,438

Post » Sat Nov 10, 2012 7:29 am

You can do the achieve the same expected result with

set text to Sprite.count-1
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Sat Nov 10, 2012 3:25 pm

We won't fix this - it relates to the breaking change a while ago that created instances don't really exist until the next top-level event. So the IIDs won't be correct until then either. Like @Yann says just use the count minus one if that's what you really want; you shouldn't really rely on any particular order of IIDs anyway, it could change again in future engine updates.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests