[Behavior] cool down mask

Post your completed addons to share with the community

Post » Sat Jul 28, 2012 1:15 am

Cool down mask

This behavior try to create a mask for displaying remainder percentage of cool down, see this demo.

Capx

User need to give this behavior a canvas object in "action:Setup canvas". User does not need to use this action for each instance, only one time for each sprite. Each instance will create canvas object at run-time.

"Action:Set percentage" is to set the percentage shown on mask.

Advance:
"Action:Pick canvas" or "Condition:Pick canvas" could get canvas instance created by this behavior. User could use any action/expression provided by canvas plugin.


Since the cooldown mask by canvas might be lag on mobile app. I made another cooldown mask which create fan shaped by fan elements.
Cooldown mask by fan spritesrexrainbow2014-02-18 04:57:40
B
97
S
22
G
178
Posts: 4,122
Reputation: 104,051

Post » Sun Jul 29, 2012 3:06 pm

Update:

Add property "Z order" to put mask front or back the sprite.
B
97
S
22
G
178
Posts: 4,122
Reputation: 104,051

Post » Sun Jul 29, 2012 3:11 pm

Good work Rex i LF something like this :)
B
32
S
9
G
5
Posts: 27
Reputation: 5,283

Post » Wed Jan 01, 2014 3:11 pm

Thanks for the plugin.

After using it for some time, i realised that it slows down my fps in CocoonJS by ~15 fps or even more. Is there a chance to fix this?
B
8
S
2
G
1
Posts: 14
Reputation: 1,155

Post » Tue Jan 28, 2014 5:23 am

@bombak

The performance of this behavior is depended on canvas, you might try draw something every-tick (for example, draw a circle and increase the radius) and see the performance.
B
97
S
22
G
178
Posts: 4,122
Reputation: 104,051

Post » Tue Feb 18, 2014 4:52 am

Cooldown mask by fan sprites
Since the cooldown mask by canvas might be lag on mobile app. I made another cooldown mask which create fan shaped by fan elements.

Demo
- click yellow button
Capx

Designer need to prepare a sprite object which has 9 frames with fan element shaped in degree 256, 128, 64, 32, 16, 8, 4, 2, 1
Code: Select all
fame 0 = 256 degree fan start at degree 0
fame 1 = 128 degree fan start at degree 0
fame 2 = 64 degree fan start at degree 0
fame 3 = 32 degree fan start at degree 0
fame 4 = 16 degree fan start at degree 0
fame 5 = 8 degree fan start at degree 0
fame 6 = 4 degree fan start at degree 0
fame 7 = 2 degree fan start at degree 0
fame 8 = 1 degree fan start at degree 0


Then use action: Setup fan to assign the fan sprite object type.
Action: Set percentage will create the fan shaped by these fan element sprites.
This behavior will maintain 9 sprite instances with frame index 0~8. User might see the sprite count from debug panel.

The start angle and fan direction(clockwise or anti-clock wise) could be set at properties table.rexrainbow2014-02-18 05:06:22
Last edited by rexrainbow on Sat Mar 29, 2014 4:03 pm, edited 2 times in total.
B
97
S
22
G
178
Posts: 4,122
Reputation: 104,051

Post » Thu Feb 20, 2014 8:07 am

Wow!!! I like a lot!! thanks very much for the behavior rex :D
B
15
S
5
G
2
Posts: 167
Reputation: 2,009

Post » Tue Apr 01, 2014 10:15 pm

Hey, do you mind if I use this cooldown mask for fan sprites in a commercial project I plan on releasing? If not, that's completely fine.
B
2
Posts: 6
Reputation: 187

Post » Tue Apr 01, 2014 10:33 pm

@anticloud

Sure, you could use it for any purpose.
B
97
S
22
G
178
Posts: 4,122
Reputation: 104,051

Post » Sat Apr 05, 2014 1:00 pm

rexrainbow wrote:@anticloud

Sure, you could use it for any purpose.


I'm sorry I forgot to mention, I also meant all you other plugins/behaviors, so I don't have to keep asking. If you have a problem with it, I'd have no quarrels about putting you in the credits.
B
2
Posts: 6
Reputation: 187

Next

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 5 guests