[Behavior] Inject base64 string as Sprite Image

Forum Home Forum Home > Construct 2 Development > Plugins for Construct 2
 Post Reply Post Reply Page  123 4>
Author
5,297 Rep
Post Options Post Options   Quote Pode Quote  Post ReplyReply Direct Link To This Post Topic: [Behavior] Inject base64 string as Sprite Image
    Posted: 28 Mar 2012 at 1:41pm
New build : You can now specify the width/height of the container when loading the image. The refresh should also work better. The demo is updated !
Plugin : http://dl.dropbox.com/u/1412774/InjectImage/pode_injectImage.0.2.zip
.capx : http://dl.dropbox.com/u/1412774/InjectImage/InjectImage.0.2.capx


Edit : added this info : you can also directly inject the URL of an image, instead of a base64 string !

Since you can extract current Image (http://www.scirra.com/forum/behavior-extract-sprite-to-base64-string_topic50577.html), why not inject Image ?


http://dl.dropbox.com/u/1412774/InjectImage/index.html

For the moment, you can inject base64 string, and it's going to replace the current Sprite image's texture.

.capx : http://dl.dropbox.com/u/1412774/InjectImage/InjectImage.capx
Plugin : http://dl.dropbox.com/u/1412774/InjectImage/pode_injectImage.0.1.zip

BEWARE !! The collision polygon used is stilll the one from the first Sprite ! So for the moment, if you use collisions, and want that everything goes smooth, keep injecting images of roughly the same shape !
If you don't use collisions, you don't care about that anyway

I'm going to provide a way to specify a new polygon in a new release...

Edited by Pode - 16 Apr 2012 at 2:06pm
Back to Top
2,772 Rep
Post Options Post Options   Quote Joe7 Quote  Post ReplyReply Direct Link To This Post Posted: 28 Mar 2012 at 4:01pm
Very cool. Now it's propable possible to save and load images in simple textfiles..
Back to Top
16,524 Rep
Post Options Post Options   Quote newt Quote  Post ReplyReply Direct Link To This Post Posted: 28 Mar 2012 at 4:59pm
There ya go, encapsulation. Ha ha, take that flash!
Just need a way to do that with sound, which I think is in the works.
Might see if @Ashley could add a way to change the poly from the ide tho...
Back to Top
306 Rep
Post Options Post Options   Quote Lord Quote  Post ReplyReply Direct Link To This Post Posted: 29 Mar 2012 at 9:51pm
@Poda thanks for pointing me to this plugin, it does what i need!!

Edited by Lord - 30 Mar 2012 at 1:32am
Back to Top
5,530 Rep
Post Options Post Options   Quote 0plus1 Quote  Post ReplyReply Direct Link To This Post Posted: 01 Apr 2012 at 9:22am
Unable to load plugin in XXX: Found 'GetPluginSettings' global, but it is not a function.

This plugin will not be available in the editor.

EDIT: Disregard my ignorance.. I leave this in case somebody has the same problem. This is a Behavior not a plugin, so it goes in the behaviors folder!

Edited by 0plus1 - 01 Apr 2012 at 9:27am
Back to Top
5,530 Rep
Post Options Post Options   Quote 0plus1 Quote  Post ReplyReply Direct Link To This Post Posted: 04 Apr 2012 at 10:05am
I would like to say that this is the single most useful plugin for c2.
The way Pode handled this is pure genius and simply works. If you have a large application, especially for mobile this can turn c2 into a professional tool because it adds resource managment.

I offered a reward to Pode because it saved my project that I was about to throw away and convert to another framework, he's such a nice guy that he didn't accept anything.

Seriously guys this tools is a lifesaver, until Ashley write some sort of resource managment if you are developing for mobile this tools is compulsory for large projects and can drastically increase fps in slower phones.

Kudos!
Back to Top
1,552 Rep
Post Options Post Options   Quote Wishy Quote  Post ReplyReply Direct Link To This Post Posted: 08 Apr 2012 at 8:52pm
@Pode could you take a look at this ?
http://www.scirra.com/forum/base64-bugs_topic50978.html
Back to Top
5,297 Rep
Post Options Post Options   Quote Pode Quote  Post ReplyReply Direct Link To This Post Posted: 09 Apr 2012 at 9:04am
@Wishy : I answered your post, and added the info to the original post of this thread.
Back to Top
1,552 Rep
Post Options Post Options   Quote Wishy Quote  Post ReplyReply Direct Link To This Post Posted: 09 Apr 2012 at 12:37pm
Awesome man, thnx for the help !!!
Back to Top
4,783 Rep
Post Options Post Options   Quote Mulkaccino Quote  Post ReplyReply Direct Link To This Post Posted: 10 Apr 2012 at 1:50am
Hi Pode,
When you get a moment, can you give an example capx of how to inject the URL of an image?
Back to Top
 Post Reply Post Reply Page  123 4>

Forum Jump Forum Permissions View Drop Down