Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Creating snapshots off screen
Started by horacebury Aug 08 2018 08:55 PM

1 reply to this topic
snapshot offscreen composer

Best Answer XeduR @Spyric , 09 August 2018 - 05:04 AM

Yeah, that's how they seem to work.

I've tackled this issue via various different means, but often I've found it enough to create and add the display objects straight into the snapshot group without any gimmicks. If I've wanted to create some things out of sight, I've usually created the display objects behind my background group, which in my case has always included a rect/imageRect that covers the entire display.

[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 2,956 posts
  • Corona SDK

It would appear that creating a snapshot offscreen causes it to be blank and calling invalidate on it does not get it to generate it's content properly.

 

I ran into this when using snapshot to create thumbnails offscreen and have them slide on from the side, using composer transitions.

 

The solution appears to be to create them onscreen but with an alpha of 0, then add them to the group being transitioned on and transition their alpha back to 1.

 

Can anyone else confirm this?

 

Sorry for the lack of code samples.



[TOPIC: post.html]
#2

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Enthusiast

  • 71 posts
  • Corona SDK

  Best Answer

Yeah, that's how they seem to work.

I've tackled this issue via various different means, but often I've found it enough to create and add the display objects straight into the snapshot group without any gimmicks. If I've wanted to create some things out of sight, I've usually created the display objects behind my background group, which in my case has always included a rect/imageRect that covers the entire display.


  • horacebury likes this


[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: snapshot, offscreen, composer