How do I make tiled background image change

Get help using Construct 2

Post » Sun May 03, 2015 9:23 pm

im making an auto runner with the template so far it's fine but im making it so that once you get to certain distance it change level ''the background and the platforme''
and i want the bloc to change for each level
B
11
S
6
Posts: 19
Reputation: 1,086

Post » Sun May 03, 2015 11:48 pm

Currently the tiled background in C2 does not support animations, if it was a Sprite you would simply change its animation to change its appearance, but in your case, it is impossible.

The solution is to use another tiled background object.

You may have created some events to scroll your tiled background or do other stuff to it. If you add another tiled background, you either have to copy-paste all the events applied to the first one, then replace it with the new one (right-click, replace object). The best solution however would be to create a Family for all your tiled backgrounds, then have your events work with this family so you don't repeat yourself.

Another solution, if you want to do it quickly, is to put different backgrounds on different layers and set one layer visible at a time.
ImageImage
B
43
S
13
G
10
Posts: 164
Reputation: 7,650

Post » Mon May 04, 2015 2:46 am

You can also try:
Image
Image
Image

TiledBackgraund replacement should be the same size as the "originals"...
(so if "Block" is 64x64......"Block1","Block2"............"BlockX" should be the 64x64)

https://www.scirra.com/manual/141/files
B
66
S
24
G
7
Posts: 1,515
Reputation: 11,041

Post » Thu May 07, 2015 4:24 pm

thx, i'll try that so we can use the load image url with sprite that are in game file? =D
B
11
S
6
Posts: 19
Reputation: 1,086

Post » Sun Feb 05, 2017 7:10 pm

Sorry to bump after so many years, but this load image from url looks interesting for all of the instances of a particular tiled background. Does this actually work? And could I loop through several different images for an animated tiled background effect?
B
41
S
12
G
14
Posts: 1,120
Reputation: 11,259

Post » Sun Feb 05, 2017 7:47 pm

@Zebbi
It's simple enough to test and see. Loading images is done per instance with tiledbackground instead as with per object type with sprites. To animate you probably would want to just create a bunch of instances, load a different image per one, and cycle which one is visible.
B
92
S
32
G
110
Posts: 5,295
Reputation: 71,501

Post » Sun Feb 05, 2017 7:56 pm

R0J0hound wrote:@Zebbi
It's simple enough to test and see. Loading images is done per instance with tiledbackground instead as with per object type with sprites. To animate you probably would want to just create a bunch of instances, load a different image per one, and cycle which one is visible.

Yes, the problem is for designing a level, it would involve placing multiples of the same object over each other, whereas with an image, I could theoretically just store the different frames of animation and load each one of the frames sequentially to every instance of the tiled background of it's type (say, tiledbackground 7)?
B
41
S
12
G
14
Posts: 1,120
Reputation: 11,259

Post » Sun Feb 05, 2017 8:10 pm

R0J0hound wrote:@Zebbi
It's simple enough to test and see. Loading images is done per instance with tiledbackground instead as with per object type with sprites. To animate you probably would want to just create a bunch of instances, load a different image per one, and cycle which one is visible.


If one were to use URL would that mean the player would have to be online for the background to load?
So assuming a player is offline, the BG would just display the current layer background?
Image Image Image
B
31
S
11
G
27
Posts: 748
Reputation: 17,093

Post » Sun Feb 05, 2017 8:16 pm

MPPlantOfficial wrote:
R0J0hound wrote:@Zebbi
It's simple enough to test and see. Loading images is done per instance with tiledbackground instead as with per object type with sprites. To animate you probably would want to just create a bunch of instances, load a different image per one, and cycle which one is visible.


If one were to use URL would that mean the player would have to be online for the background to load?
So assuming a player is offline, the BG would just display the current layer background?

I think it works locally? It's just as it uses html5, I think it uses the syntax?
B
41
S
12
G
14
Posts: 1,120
Reputation: 11,259

Post » Thu Feb 16, 2017 6:09 pm

@R0J0hound Just before I do this myself, would this actually change every instance with a new image or does it work on a per instance basis?
B
41
S
12
G
14
Posts: 1,120
Reputation: 11,259

Next

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, dand, tinhofiel and 29 guests