Add a base64 property for the Sprite object ?

Discussion and feedback on Construct 2

Post » Sat Nov 19, 2011 2:13 pm

Is it possible for Ashley or Tom to add the possibility to specify the current image for a Sprite as a base64 string ? I made a fork of the javascript for the Sprite plugin and tried to do that there, but I can't manage to make it update itself onscreen when the base64 string is added (and I think it's simpler if that property lies in the main Sprite object...)
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Sat Nov 19, 2011 4:31 pm

I'm not sure I understand why that's useful - when do you need to use a Base64 string instead of, say, the URL of an image?
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Sat Nov 19, 2011 4:50 pm

Using CallJS, I can access base64 representation of image located inside the index.html DOM. The way to add that image, by returning from CallJS, is to use that base64 string inside C2's canvas. I'm doing that because I have some JS code outside C2 that can modify images, and that code is to complex for me to import inside C2.
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Sat Nov 19, 2011 6:05 pm

A better solution would be a plugin that can load that image directly, which does not require using base64 at all and is probably the same amount of work!
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Sat Nov 19, 2011 8:19 pm

OK. I'm going to try that direction. Thanks.Pode2011-11-19 20:20:37
B
33
S
9
G
6
Posts: 709
Reputation: 6,704


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 7 guests