How do I MAke the BG image change size while game running?

Get help using Construct 2

Post » Sat Jul 22, 2017 2:45 pm

Hi,

I want my BG to slowly grow in size whil the layout runs. Nothing major...very subtle but needs to run for 120 seconds.

Any ideas?
Thanks
B
9
S
2
Posts: 104
Reputation: 975

Post » Tue Jul 25, 2017 6:17 pm

No one?
B
9
S
2
Posts: 104
Reputation: 975

Post » Wed Jul 26, 2017 2:12 am

Every X seconds
-> set bg.width to self.width+1
-> set bg.height to self.height+1

That's the simplest way to do something like that... it becomes more complicated if you want to maintain aspect ratios and stuff like that, but for simple explanation you just want to change the width and height every X seconds perhaps?

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499

Post » Wed Jul 26, 2017 2:39 pm

oh I see what you are saying. Thanks I'll give it a try. It is for the title screen so it is not 100% necessary I just think it would add a little the over screen...vs the static BG.
B
9
S
2
Posts: 104
Reputation: 975

Post » Wed Jul 26, 2017 5:20 pm

You can add the sine behavior to the background sprite. Set the movement of the sine to: "Size" , set magnitude "50" or whatever you want (you can experiment) and set the period to 240 (120x2) and see how it goes.
B
41
S
10
G
9
Posts: 213
Reputation: 7,089

Post » Wed Jul 26, 2017 6:35 pm

SoldjahBoy wrote:Every X seconds
-> set bg.width to self.width+1
-> set bg.height to self.height+1

That's the simplest way to do something like that... it becomes more complicated if you want to maintain aspect ratios and stuff like that, but for simple explanation you just want to change the width and height every X seconds perhaps?

~Sol


This appears to add it and then take it away. T give like a shake kind of effect. :)
B
9
S
2
Posts: 104
Reputation: 975

Post » Wed Jul 26, 2017 6:37 pm

anty21ro wrote:You can add the sine behavior to the background sprite. Set the movement of the sine to: "Size" , set magnitude "50" or whatever you want (you can experiment) and set the period to 240 (120x2) and see how it goes.


Had to bump magnitude up to 500 but see some growth...editied down to 250 and looks good...i think this will do the trick Thanks!
B
9
S
2
Posts: 104
Reputation: 975


Return to How do I....?

Who is online

Users browsing this forum: draiza, matriax and 25 guests