How to export base64 Sprite Image with Webgl Shader Effect?

Discussion and feedback on Construct 2

Post » Mon Jul 11, 2016 1:55 pm

Hey guys!

I modify a sprite with a shader effect on construct 2. I want to get the image with shader effect, but i don't know how.

I get the image without shader using a function
Code: Select all
DrawImage()
and print in a new buffered canvas... But i want to get the sprite with WebGL.

But why do i want to do this?
1. I want to download the sprite with the shader with browser plugin;
2. I want to change the current sprite with the new sprite with shader and disable the sprite plugin shader. Becouse if i still using shader at run time, the game will be slow.

Thanks for any help.
B
14
S
6
G
2
Posts: 81
Reputation: 2,241

Post » Mon Jul 11, 2016 2:42 pm

Just use the printscreen button and then paste the clipboard image into a blank project of your favourite image editor?
B
36
S
18
G
11
Posts: 248
Reputation: 8,694

Post » Mon Jul 11, 2016 3:08 pm

Sethmaster wrote:Just use the printscreen button and then paste the clipboard image into a blank project of your favourite image editor?


I want to get the image at runtime to do a new plugin.
B
14
S
6
G
2
Posts: 81
Reputation: 2,241

Post » Mon Jul 11, 2016 7:36 pm

Look at the paster object, it can probably do what you want, or you can see how it does it.
It's roughly based on how C2's runtime uses effects, because unfortunately I couldn't find a way to use it directly.
B
91
S
31
G
103
Posts: 5,235
Reputation: 67,756

Post » Mon Jul 11, 2016 8:52 pm

R0J0hound wrote:Look at the paster object, it can probably do what you want, or you can see how it does it.
It's roughly based on how C2's runtime uses effects, because unfortunately I couldn't find a way to use it directly.


Cool but i have 50 instance at the same sprite, everyone with different color effect enabled. When i use the paster and change the last instance, all the instance will have the same sprite. What do i do?
B
14
S
6
G
2
Posts: 81
Reputation: 2,241

Post » Mon Jul 11, 2016 9:12 pm

The animation frames of a sprite are shared between all the instances, so if you replace one they all change. You could just use paster instances instead of sprites i guess.
B
91
S
31
G
103
Posts: 5,235
Reputation: 67,756

Post » Mon Jul 11, 2016 11:20 pm

R0J0hound wrote:The animation frames of a sprite are shared between all the instances, so if you replace one they all change. You could just use paster instances instead of sprites i guess.


Hum, i got it! Thanks. But. Can i use Pasters than Sprites? Pasters script is more heavy?
B
14
S
6
G
2
Posts: 81
Reputation: 2,241

Post » Tue Jul 12, 2016 3:04 am

Each instance has it's own texture, whereas sprites share the same texture. It just depends on what you want to do.
B
91
S
31
G
103
Posts: 5,235
Reputation: 67,756

Post » Tue Jul 12, 2016 11:51 am

R0J0hound wrote:Each instance has it's own texture, whereas sprites share the same texture. It just depends on what you want to do.


I got it. Thank you! :D
B
14
S
6
G
2
Posts: 81
Reputation: 2,241


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 5 guests