How do I gradually increase the Numbers in text?

Get help using Construct 2

Post » Tue Sep 26, 2017 12:58 am

dop2000 wrote:I understand you want to animate your scores?
I made a small demo:
Tween Demo

CAPX


you could achieve the same thing with distance(score,0,rewardedtobeadded,0)/10 i think.
ImageImageImageImageImageImage
B
87
S
26
G
75
Posts: 1,458
Reputation: 47,940

Post » Tue Sep 26, 2017 4:50 am

@gamecorpstudio
I don't get it..
If initial score=500 and I want to add 20, then distance(score,0,rewardedtobeadded,0)/10=48
What should I do with this number?
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
19
S
9
G
158
Posts: 2,403
Reputation: 84,433

Post » Tue Sep 26, 2017 5:53 pm

dop2000 wrote:@gamecorpstudio
I don't get it..
If initial score=500 and I want to add 20, then distance(score,0,rewardedtobeadded,0)/10=48
What should I do with this number?


let me do a capx il edit here ! better to show then tell.. i know the math sounds weird but works from what i tested on other projects using that "formula" for easy incrementals.


Edited (2 minutes later) : as promised now the division is value "20" not "10"... "10" was what i used for movement but is basically the same formula.
The so called "formula" it's actually a sort of a no sort of a % comparison of the two numbers no matter what the number is... the increment is always going to be accurate. it's either how is supposed to work or is a C2 glitch... however this is how i always used it... if it's going to change in any update soon... i want to keep this C2 version lol. makes life easier.

i hope it's helpful and you ( @sublimate or who might need it) cut off the extra plugins that might cause problems in mobile compilations. im pretty sure this method works with C3 also as long as you have the expressions there. capx incremental number using distance

to get the exact ease-in incremental just increase the divided" %" or the value "20" to "30" or "40".

extra perk "no custom plugins" and works with any number.

known issues, you might need an boolean/variable/trigger /condition whatever you might call it, to detect when the increment is happening so you dont double time reward if you multi click it(thats if will be triggered by click). if it's only triggered at end of round or achievement or reward for destroying something or collecting some coins then there is no need for extra conditions just copy paste it(make sure you got the global variables in your capx when you transfer and add the "trigger one time" properly).

@sublimate check the capx above maybe is a better alternative for what you want.
ImageImageImageImageImageImage
B
87
S
26
G
75
Posts: 1,458
Reputation: 47,940

Post » Wed Sep 27, 2017 1:44 am

@gamecorpstudio thanks for the detailed explanation and demo! Although this method has some limitations comparing to tween behaviors, it's definitely useful.

This formula appears to be similar to "easind Out" tween function, can it be modified to simulate "easing In"? (slow at the beginning, gets faster at the end)
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
19
S
9
G
158
Posts: 2,403
Reputation: 84,433

Post » Wed Sep 27, 2017 10:41 am

dop2000 wrote:@gamecorpstudio thanks for the detailed explanation and demo! Although this method has some limitations comparing to tween behaviors, it's definitely useful.

This formula appears to be similar to "easind Out" tween function, can it be modified to simulate "easing In"? (slow at the beginning, gets faster at the end)


that can happen if you decrease the / number while dividing it so you start with a division by 100 let's say, and then every 0.01 subtract 1 from that 100 and the reversed incremental should appear like that "easing in". -Edited: scratch that ... im working on it, the distance adding is automatically doing its own easing out effect cause the distance is always shrinking, so what would make sense after a surtain number the distance to be at a surtain number that creates the illusion of fastening up. its definitely doable but im not sure if distance would work for the reversed effect.

Honestly i never used the tween plugin didn't found it useful for my own, it's definitely a interesting plugin and helps a lot of people just i think it's an extra dependency that is not really needed once you know C2 expressions. i guess for desktop targeted games wont cause problems the plugin itself but some compilers for mobile will probably have issues with it, if not now in future for sure, unless it's updated by the dev.
ImageImageImageImageImageImage
B
87
S
26
G
75
Posts: 1,458
Reputation: 47,940

Post » Wed Sep 27, 2017 12:41 pm

Hey if it takes too much time, forget it. I asked out of curiosity.

Yeah, I'm probably using the LiteTween plugin a bit too much in my game. But it's so convenient, has lots of useful events, it's hard to resist.
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
19
S
9
G
158
Posts: 2,403
Reputation: 84,433

Previous

Return to How do I....?

Who is online

Users browsing this forum: hendi544, keithtammy and 3 guests