Comment by BSTRhino
3 months ago
The implicit ID is just an auto-incremented number actually, it's not anything too special. That means, if you have a loop, the component has the same ID each time and gets replaced. That is a feature, not a bug. So this code snippet will keep replacing the text sprite with a new one, counting from 1 to 10:
for i in RangeInclusive(1, 10) { TextSprite(i) }
Yes, you found the right place in the documentation. Thanks, yes I worked very hard on the documentation!
Ah, so you don't do parallel with implicit IDs right now, I'm guessing. Or you do, but it has some interesting bugs as the IDs shift around? Or the scope of the auto-incrementing number is lower than "the entire program" so parallel works?
It sounds like you are asking, if auto-incrementing IDs are assigned in parallel at runtime, then order of execution of the threads must affect which ID gets assigned to what, and that must make some interesting bugs?
The IDs are assigned at compile time by the Easel compiler. So they don’t change in any way at runtime. Does that answer your question?
Mostly - if the IDs are assigned at compile time, how do you deal with _runtime_ locations like "the fifth iteration of a For loop"?
1 reply →