Opacity and dt

Get help using Construct 2

Post » Thu May 17, 2012 2:32 am

From what I understand (which is very little) something like this should cause an object to fade in to 100 in 1 second:

Sprite.opacity + 100*dt

However, when I use it with a mouse click event, it only fades by 1. What am I doing wrong?
B
16
S
6
Posts: 33
Reputation: 1,620

Post » Thu May 17, 2012 3:57 am

It has to loop through until sprite's opacity is zero. Make the mouseclick turn on some variable, and then have that variable be a condition for the sprite to lose its opacity.
B
14
S
1
G
2
Posts: 85
Reputation: 2,810

Post » Thu May 17, 2012 11:32 am

Do you know of an example file or explain what you typed there for dummies? :)
B
16
S
6
Posts: 33
Reputation: 1,620

Post » Thu May 17, 2012 12:31 pm

New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Thu May 17, 2012 3:11 pm

Awesome, thank you very much! So if I'm understanding this correctly, it's the instance variable that is telling it to check every tick and this makes it fade in to full opacity or not?
B
16
S
6
Posts: 33
Reputation: 1,620

Post » Thu May 17, 2012 8:44 pm

It is important to understand the difference between trigger events, and continuous events.
dt should only be used in continuous events.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Thu May 17, 2012 10:05 pm

I create this same thing, i mean destroy sprite and just spawn this same looking sprite but with fade option
B
93
S
19
G
34
Posts: 1,840
Reputation: 27,963

Post » Thu May 17, 2012 10:32 pm

[QUOTE=delgado] I create this same thing, i mean destroy sprite and just spawn this same looking sprite but with fade option[/QUOTE]

I tried that but for some reason, I couldn't get the coordinates of the spawn correct. :P
B
16
S
6
Posts: 33
Reputation: 1,620

Post » Fri May 18, 2012 3:23 pm

Use only image point (to coordinate sprites) and it spawn correct
B
93
S
19
G
34
Posts: 1,840
Reputation: 27,963


Return to How do I....?

Who is online

Users browsing this forum: anty21ro, Braus and 2 guests