[Behavior] Image Effects for Sprite

Post your completed addons to share with the community

Post » Wed May 02, 2012 2:43 pm

BIG UPDATE ! The Image Effects behavior is now merged with the Text On Sprite behavior ! You can find the new version here : http://www.scirra.com/forum/behavior-inject-text-on-sprite_topic51516_post324649.html#324649

Here's a behavior to apply image effects to a Sprite.



Everything is done in Javascript, so it's slow. And ressources intensive, so don't use it to apply effects all the time, everywhere !

For the moment you can apply Sepia, Grayscale, a simple Blur, and Color correction (you need to test that last one yourself, to know what numbers to use to apply a color change. The 3 R,G,B parameters specify the amount by which each original pixel is going to be multiplied. So '1' means no change, less than 1 mean less of that color channel, and more than 1 mean more of that channel). It's way slower than the Recolor Behavior to recolorize Sprites, but it uses way less memory (it's a tradoff you need to take into account when designing your game).

You can reset the filters if you save the original image first (there's a "save original" function). Since it's using some memory to store the original image, I didn't made the behavior use the save by deffault. So if you reset without having done a save before, you get blank images !

You can also get back the filtered image and the original image (if saved previously) as base64 strings.

The demo : http://dl.dropbox.com/u/1412774/C2ImageEffectsDemo/index.html
The plugin : http://dl.dropbox.com/u/1412774/C2ImageEffectsDemo/pode_imageEffects.1.0.zip
The .capx : http://dl.dropbox.com/u/1412774/C2ImageEffectsDemo/C2ImageEffectsDemo.capxPode2012-05-03 17:28:30
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Wed May 02, 2012 2:56 pm

Hi, it does not seem to work on Chrome 18. I got the effect applied message but nothing happened to the sprites.
B
19
S
5
G
5
Posts: 48
Reputation: 4,843

Post » Wed May 02, 2012 3:24 pm

@IronRick : it's strange because I tested it on Chrome 18. I'm going to check that.
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Wed May 02, 2012 3:28 pm

@Pode: I am using Win 7, 64-bit, chrome 18.0.1025.168 if it could help.

I also tested with IE9 and it worked fine there.
B
19
S
5
G
5
Posts: 48
Reputation: 4,843

Post » Wed May 02, 2012 5:45 pm

Tried the demo in Chrome 18 and Firefox 12, none worked.

I click the effects buttons and nothing happens besides displaying the 'effect applied' text.
Scirra Employee
B
129
S
45
G
15
Posts: 705
Reputation: 15,413

Post » Thu May 03, 2012 11:04 am

Tried in Safari on an iPad 2 (IOS 5.1) and it works well in the first time I used all the effects, but when I reset, do not applied the effects again.NRABrazil2012-05-03 11:07:55
B
90
S
5
G
8
Posts: 164
Reputation: 7,646

Post » Mon Jun 04, 2012 7:35 pm

Not working here ;/
Using Chrome 19.0.1084.52 m on Win7 64x
B
38
S
8
G
3
Posts: 438
Reputation: 6,869

Post » Tue Jun 05, 2012 2:12 pm

@sheepy : it's now merged with the 'Text On Sprite' behavior, as stated on top (it's easier for me to manage one plugin instead of two...).
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Tue Jun 05, 2012 4:46 pm

@Pode Thank you, this is a great behavior ;]
B
38
S
8
G
3
Posts: 438
Reputation: 6,869

Post » Fri Jun 22, 2012 11:51 pm

hmm any option dont work on my firefox and chrome
B
93
S
19
G
34
Posts: 1,840
Reputation: 27,963

Next

Return to Completed Addons

Who is online

Users browsing this forum: tanzero, totoe, Yahoo [Bot] and 2 guests