How to use a large sliced bg image

Get help using Construct 2

Post » Fri Jan 17, 2014 3:55 pm

Hi!

This is my very first Construct 2 project and I'm wondering how I should load up my background.

I have a huge background image (originally something like 8000 x 1000 px) which I have sliced into 1024x1024 chunks in Photoshop.

How can I now accurately place these slices as a background in Construct 2 without leaving any gaps between them? I tried to use the "tiled background" feature but couldn't figure out how to load multiple images side by side..neutrinox2014-01-17 15:57:02
B
9
S
1
Posts: 97
Reputation: 715

Post » Fri Jan 17, 2014 4:05 pm

Hi,

you may wanna use a couple of different approaches here.

Tiled Background is for repeating parts, there is no way of putting in multiple images here.

So either go reduce your background to a repeated part, and parts that differ and place those parts as sprites or as tiled backgrounds as well.

There is a tutorial in the tutorial section by Ashley which covers performance.
B
22
S
7
G
4
Posts: 154
Reputation: 3,709

Post » Fri Jan 17, 2014 4:16 pm

Hi!

The background is a photograph and every pixel is unique so I can't make use of repeated tiles.

Was the tutorial you are referring to called:
"supporting-multiple-screen-sizes"?

I'm not sure which part of that tutorial applies to my situation.

How would you approach adding multiple background slices together without leaving small gaps in between?neutrinox2014-01-17 16:17:13
B
9
S
1
Posts: 97
Reputation: 715

Post » Fri Jan 17, 2014 5:43 pm

You could place them on the layout manually.
But I guess you have a reason for slicing the image up.
Why do you need such a big background without repeat?
Even with slicing it will take a considerable amount of graphic memory.
8000x1000x4 bytes to be precise.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Jan 17, 2014 10:26 pm

I had to slice it up because otherwise I got errors from crossing the 2048x2048 image size boundary. I need such a big background without repeat because the game happens in a real place (photograph).
B
9
S
1
Posts: 97
Reputation: 715

Post » Sat Jan 18, 2014 6:48 pm

Simply place them all next to each other like this. (assuming you have 6 pieces)

on layout start

part 1 - set position 0,0
part 2 - set position part1.width, 0
part 3 - set position part2.width, 0
part 4 - set position 0 , 0-part4.height
part 5 - set position part4.width, 0-part2.height
part 6 - set position part5.width, 0-part3.height

this puts them in a 2x3 grid

im sure there's a fancier way to do it with an array, but im not as good that those.
B
87
S
44
G
16
Posts: 1,005
Reputation: 17,938

Post » Sat Jan 18, 2014 8:06 pm

slice them up as you have them. Pute them in 1 single sprite as different frames(don't foget to turn set animation speed to 0)

turn on snap to grid then you can place manually.

if you need to place dynamically. Then justifun is the better method to do it programattically.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,028


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, PROxMTswatTR and 16 guests