Get Rendered Frame As Texture

Forum for plugin, effect and behavior programmers. Please use the Help & Support forum for help using Construct.

Post » Thu Jul 30, 2009 11:23 pm

Is there a way to retrieve the rendered frame as a texture? For examples, so I could change the texture on a sprite to that of the currently rendered frame.
Moderator
B
98
S
36
G
19
Posts: 1,584
Reputation: 17,717

Post » Fri Jul 31, 2009 3:41 am

you can use the Canvas object and paste on it.
I'm not sure if you can paste a layer or a whole layout though, haven't much experience with it (as it does weird stuff on my video card)
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Fri Jul 31, 2009 4:25 am

Paste into canvas, copy from canvas to image manipulator, image manipulator save image(as png, jpg, etc), sprite load frame.... but that doesn't work. Image manipulator is not saving images correctly. Once its fixed then that should work, just dont forget to leave a tick between each event.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Fri Jul 31, 2009 6:12 am

I guess I should have been more specific. I'm talking about doing this in the SDK. :P
Moderator
B
98
S
36
G
19
Posts: 1,584
Reputation: 17,717

Post » Fri Jul 31, 2009 9:35 am

I'm not at my Construct machine right now, but there should be a function along the lines of SetCopyLayoutContent, which is what the Canvas object uses to grab the layout as a texture.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Sat Aug 01, 2009 6:33 pm

I found SetCopyFrameContent. This is my code(probably not correct):

[code:f1dg8ljp]pRuntime->SetCopyFrameContent(pLink, pLink->info.curTexture, true, true);[/code:f1dg8ljp]

When I run the plugin, Construct crashes telling me the texture isn't a render target. Any clarification on this? There doesn't seem to be much documentation in the line of graphics related stuff.
Moderator
B
98
S
36
G
19
Posts: 1,584
Reputation: 17,717


Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 0 guests