Add art borders to a square game.

Get help using Construct 2

Post » Sun Nov 10, 2013 5:16 pm

*Edit: This seems to be impossible to do with integer scaling as of version r148*

I would like images around my game instead of ugly black bars. Any tips?HacksawUnit2013-11-11 18:15:55
B
9
S
3
Posts: 52
Reputation: 1,260

Post » Sun Nov 10, 2013 6:13 pm

Editing the file index.html should do the trick.
[QUOTE]<!-- All margins and padding must be zero for the canvas to fill the screen. -->
<style type="text/css">
     * {
          padding: 0;
          margin: 0;
     }
     body {
          background: #000;
          color: #fff;
          overflow: hidden;
          -ms-touch-action: none;
     }
          canvas {
              touch-action-delay: none;
              touch-action: none;
              -ms-touch-action: none;
     }
</style>[/QUOTE]
Replace background: #000 with background-image:url('your_image.png') .

More info here: http://www.w3schools.com/css/css_background.aspTGeorgeMihai2013-11-10 18:15:12
B
49
S
15
G
6
Posts: 535
Reputation: 7,197

Post » Sun Nov 10, 2013 6:32 pm

That's very useful, thanks! My game will be a desktop application, though. Are there any workarounds for that? :-)
B
9
S
3
Posts: 52
Reputation: 1,260

Post » Sun Nov 10, 2013 11:47 pm

Bump!
B
9
S
3
Posts: 52
Reputation: 1,260

Post » Mon Nov 11, 2013 12:39 am

Uh...If your game is going to be a desktop application then there will be no black bars...
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Mon Nov 11, 2013 1:27 pm

If the user resizes the window or enters fullscreen (which will be important because my game is very small pixel-wise), black bars appear.
B
9
S
3
Posts: 52
Reputation: 1,260

Post » Mon Nov 11, 2013 1:57 pm

Just add the images you'd like at the sides of your playing field. The dotted line in the editor window.

I'm guessing you are using scale outer, so the images will appear when the window is wider than your project size.
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 » Mon Nov 11, 2013 2:02 pm

I am using integer scaling, and the fix you suggested did not work. :-(
B
9
S
3
Posts: 52
Reputation: 1,260

Post » Mon Nov 11, 2013 5:31 pm

Bump.
B
9
S
3
Posts: 52
Reputation: 1,260

Post » Mon Nov 11, 2013 5:47 pm

As you can read here black bars are normal with letterbox integer scale.
Using another scaling option it can be avoided, because you don't limit the scaling.
Probably you dont want other scaling because of pixel-art, if so, your "problem" can't be solved.
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

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests