How do I create a circular cooldown display?

Get help using Construct 2

Post » Mon Jun 23, 2014 8:29 pm

Bl4ckSh33p wrote:Nice. This is great for a healthbar. :)
But I get a headache when I look at the used formula to rotate the images.

May I ask if you do know a solution without mask to have an overlay (grey/transparent square over a button for example) which rotates in a circle like a clock? A classic clock cooldown display like many MMOs have on their buttons. Do you know what I mean?
circular298.GIF

The button/image is in the background and when you use it the whole button is greyed out and the "clock" runs around until the cooldown is finished and the whole button is visible again. Is this possible without the canvas or other plugins?


Without a mask, I do not know, however I did add some modifications to my original circular healthbar to make it so its origin can spin around (to be correct, it defines the origin and max angle relative to this origin), but that did make the math rather complex (I even fell in a case when -270 and 90 degress weren t working the same way as origins, which was weird), so i am not sure, i can give it if you want
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Mon Jun 23, 2014 8:46 pm

Use two sprites. Top sprite's opacity set to less than 100, you're done.
You do not have the required permissions to view the files attached to this post.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
288
S
111
G
94
Posts: 7,332
Reputation: 69,160

Post » Mon Jun 23, 2014 8:48 pm

@kyatric. Thank you, simple solution
B
13
S
5
G
1
Posts: 119
Reputation: 2,292

Post » Mon Jun 23, 2014 8:50 pm

Not what the OP asked though.
To answer Bl4ckSh33p, as far as I'm aware, you need to use masks and/or layers to have the transparency you're looking for, and that's what blending modes are for.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
288
S
111
G
94
Posts: 7,332
Reputation: 69,160

Post » Tue Jun 24, 2014 9:02 am

Thank you. I just had an idea. Maybe I can use the .gif from above (the last half of the animation) and convert it to single frames / a spritesheet and then change the frames depencing on cooldown progress. :)
This should produce the "clock cooldown".

And another very easy solution (without radial display) would be just a sprite on top with transparency to cover the button and then set the heigth of it depending on cooldown time.
B
54
S
16
G
6
Posts: 719
Reputation: 9,207

Post » Tue Jun 24, 2014 8:33 pm

edit:
Here's a capx similar to the timer in your picture ; It uses blend modes, hope it helps.
Demo
Download (new)
Last edited by Noncentz705 on Thu Jul 10, 2014 3:16 pm, edited 3 times in total.
B
11
S
2
G
1
Posts: 202
Reputation: 1,580

Post » Tue Jun 24, 2014 8:42 pm

@Bl4ckSh33p
I'm not sure why you want to avoid the canvas plugin? It's THE solution for things like this, and quite easy to implement.
Image
B
24
S
8
G
10
Posts: 1,821
Reputation: 8,279

Post » Thu Jun 26, 2014 1:40 pm

@tulamide : for a long term game, third party plugins represent a risk/reward situation:

-More functionnalities, but also they can break one day due to some factors (new update of C2, the plugin's creator not updating anymore for a variety of reasons), whereas vanilla C2 tends to be a less risky way (since the stable versions are normally pretty well done), and since you do the code with vanilla C2 (aka: rely less on third party solutions), if something does not work, it is more likely your own fault.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Thu Jun 26, 2014 1:43 pm

Exactly what @Aphrodite said. :)
I try to use no addons/plugins if possible to be "safe" if a new update breaks it or the author stops developing/supporting it.
B
54
S
16
G
6
Posts: 719
Reputation: 9,207

Post » Thu Jun 26, 2014 3:11 pm

@Aphrodite
@Bl4ckSh33p

I understand the logic behind the thoughts and respect your stand. And I don't want to derail this thread. But still: Isn't that against the core system of C2? The extendability by plugins is a feature, isn't it? Even C2 itself is based on plugins (I understand that you think they are always safe, while 3rd party may not). Wouldn't it make your life much easier on a long term project, when instead of constantly updating C2 with the risk of breaking something (yes, that can very well happen with C2's own elements, too), you'd stick to one version of C2, with one version of all 3rd party plugins?

Again, this isn't quite the right place to discuss it. So maybe just take it as an suggestion for an easier development process - or just ignore it :D
Image
B
24
S
8
G
10
Posts: 1,821
Reputation: 8,279

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: blue visionary and 26 guests