Groups within Groups within Snapshots?

Just wondering if I am having a brain fade or if there is an issue with having a group within a group in a snapshot? I have made a very simple example to illustrate (came from a much more complex app). The small white box should move across the full width of the larger red box (the snapshot), but when it gets half way across it dissapears!

Code below and main.lua attached.

Any help would be much appreciated!

David

--1st group local mGroup = display.newGroup() -- 2nd group local tGroup = display.newGroup() -- snapshot local snap = display.newSnapshot(200, 200) snap.x = 160 snap.y = 100 --Snapshot Background Rect local bg = display.newRect(0,0,200,200) bg:setFillColor(1,0,0,0.5) snap.group:insert(bg) --Test Obj local testObj = display.newRect (120,0,10,10) mGroup:insert(testObj) tGroup:insert (mGroup) snap.group:insert(tGroup) snap:invalidate() local function transTest() mGroup.x = mGroup.x - 1 snap:invalidate() end timer.performWithDelay(20, transTest, 200)

Hi @playthisstudios,

I suggest that you check your positioning and coordinates very carefully. There’s likely some issue where you’re placing groups with their “anchor points” where they shouldn’t be, or something like that.

Brent

Thanks for the reply Brent.

How would anchor point positioning result in the “white dot” disappearing completely out of the snapshot? Groups have no size, so if it is fine until it gets halfway across the snapshot, I am not seeing how that can be anchor point related?

It almost looks like it is getting “off screen” culled - is that possible within a snapshot situation?

D

Hi @playthisstudios,

I tested a bit more, and there does seem to be an issue with multiple nested groups inside a snapshot. If I reduce your code to use just one display group inside the snapshot, and add the white dot to that group, everything seems fine. When nesting all of this within yet another group, things start to get weird. I’m not sure what the reason is for this, unfortunately. Is there any workaround for this nested structure in your design?

Brent

Thanks Brent, at least I am not going crazy.

I can try a workaround, but it will be much more difficult (if it works at all). Do you think you can run this past engineering and get their thoughts?

Thx

Hi @playthisstudios,

I suggest that you check your positioning and coordinates very carefully. There’s likely some issue where you’re placing groups with their “anchor points” where they shouldn’t be, or something like that.

Brent

Thanks for the reply Brent.

How would anchor point positioning result in the “white dot” disappearing completely out of the snapshot? Groups have no size, so if it is fine until it gets halfway across the snapshot, I am not seeing how that can be anchor point related?

It almost looks like it is getting “off screen” culled - is that possible within a snapshot situation?

D

Hi @playthisstudios,

I tested a bit more, and there does seem to be an issue with multiple nested groups inside a snapshot. If I reduce your code to use just one display group inside the snapshot, and add the white dot to that group, everything seems fine. When nesting all of this within yet another group, things start to get weird. I’m not sure what the reason is for this, unfortunately. Is there any workaround for this nested structure in your design?

Brent

Thanks Brent, at least I am not going crazy.

I can try a workaround, but it will be much more difficult (if it works at all). Do you think you can run this past engineering and get their thoughts?

Thx

Just noting that I am also running into this issue and not doing nested groups is not going to be possible for me. I spent a few hours trying to figure out what’s going on, but there doesn’t seem to be anything I can do to fix this. Could we maybe get this issue added to some official bug list?

Hi @dwallin335,

Can you please submit a bug report, including a basic code/project which shows the issue occurring? This is how the engineers can track bugs and resolve them.

http://developer.coronalabs.com/content/bug-submission

Thanks,

Brent

Ok, I made an example project and attached it to the bug report.

Please post the bug report number that you got in the email for a reference.

Rob

Sure, it’s case 37556

For reference, here’s what I’m seeing.

Expected:

bTDaIaG.jpg

Actual:

UD0ZTfV.jpg

Seems like the snapshot is culling all the images that fall above or to the left of the center point of the snapshot (ie, < 0.0 on the x or y axis).

I’m having the same issue! It will certainly be disruptive, can it be made a priority?

Also thanks David and dwallin335 for posting - I’ve spent most of the day trying to figure out why on earth things are disappearing for no reason!

Also experiencing this issue… Groups within Groups within snapshot…

I was actually able to achieve a solid snapshot cache utilizing Groups within Groups (even within Groups) but requesting a snapshot object twice the size as necessary.

After utilizing this multiplier, the path coordinates (x,y) do not seem to be transforming correctly.  I can exaggerate the values to achieve a transform, but something appears off here.  Still testing to see if I can come up with something that looks mathematical…

Ah… after removing my groups border mask, i can see my group stack is sitting in the bottom right corner of the multiplied snapshot… hmmm

Just noting that I am also running into this issue and not doing nested groups is not going to be possible for me. I spent a few hours trying to figure out what’s going on, but there doesn’t seem to be anything I can do to fix this. Could we maybe get this issue added to some official bug list?

Hi @dwallin335,

Can you please submit a bug report, including a basic code/project which shows the issue occurring? This is how the engineers can track bugs and resolve them.

http://developer.coronalabs.com/content/bug-submission

Thanks,

Brent

Ok, I made an example project and attached it to the bug report.