[Behavior] Inject base64 string as Sprite Image

Post your completed addons to share with the community

Post » Wed Mar 28, 2012 1:41 pm

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...Pode2012-04-16 14:06:11
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Wed Mar 28, 2012 4:01 pm

Very cool. Now it's propable possible to save and load images in simple textfiles..
B
14
S
6
G
5
Posts: 173
Reputation: 4,742

Post » Wed Mar 28, 2012 4:59 pm

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...
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Thu Mar 29, 2012 9:51 pm

@Poda thanks for pointing me to this plugin, it does what i need!!Lord2012-03-30 01:32:44
B
3
Posts: 3
Reputation: 331

Post » Sun Apr 01, 2012 9:22 am

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!0plus12012-04-01 09:27:20
B
29
S
9
G
6
Posts: 525
Reputation: 8,294

Post » Wed Apr 04, 2012 10:05 am

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!
B
29
S
9
G
6
Posts: 525
Reputation: 8,294

Post » Sun Apr 08, 2012 8:52 pm

@Pode could you take a look at this ?
http://www.scirra.com/forum/base64-bugs_topic50978.html
B
22
S
11
G
9
Posts: 133
Reputation: 6,572

Post » Mon Apr 09, 2012 9:04 am

@Wishy : I answered your post, and added the info to the original post of this thread.
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Mon Apr 09, 2012 12:37 pm

Awesome man, thnx for the help !!!
B
22
S
11
G
9
Posts: 133
Reputation: 6,572

Post » Tue Apr 10, 2012 1:50 am

Hi Pode,
When you get a moment, can you give an example capx of how to inject the URL of an image?
B
51
S
13
G
8
Posts: 194
Reputation: 7,311

Next

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 0 guests