Flip part of screen? (shader?)

Get help using Construct 2

Post » Sat Nov 16, 2013 4:20 pm

I was thinking this could be done with a shader. I just want part of the screen to be flipped vertically. Maybe this Construct Classic effect is what I'm looking for:
http://www.scirra.com/forum/effect-flip-layout_topic52811.html
But I have no idea if there's a way to use it in Construct2.
B
8
S
1
Posts: 53
Reputation: 787

Post » Sat Nov 16, 2013 9:52 pm

You can use "Set Layout Angle" in system
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,361

Post » Sat Nov 16, 2013 11:56 pm

If you mean just certain layers, then you can flip horizontal by using what Joannesalfa proposed, with 180 as the angle. A vertical flip would be difficult (I can't think of any C2 option right now that would allow that, besides "set flipped"/"set mirrored" specifically for sprites)

If you are looking for a vertical flip, or if you meant a portion of the output (like just the left half of the screen) by "part of the screen", it would have to be done with an effect as of now. HLSL (used in my effect for CC) is pretty close to GLSL, so it shouldn't be a problem to use the "flip layout"-effect as a base for a C2 effect, for someone who already programmed a pixel shader in GLSL.
I'm afraid I won't have the time to do it, as I am concentrating on other things in my life.

EDIT: rotating the layer by 180 equals to both, vertical flip/horizontal mirroring at the same time.tulamide2013-11-17 00:40:39
Image
B
24
S
8
G
10
Posts: 1,821
Reputation: 8,279

Post » Sun Nov 17, 2013 3:07 pm

I guess rotating by 180 really is what I'm looking for, but doing it that way would mean redefining a lot of the behaviors.

Basically I want to make a split screen layout for tablets, so you can two people playing on the same tablet, on opposite sides, with each side facing each player. Like this game does:
http://i.imgur.com/6qIzlOE.png

The problem is, my game is a bit more complex than that, and a lot of the behaviors depend on the orientation (gravity, platform movement, etc), so a shader effect would be what I'm looking for, inverting image with a shader would make gravity point up instead of down without having to redefine any behavior.
B
8
S
1
Posts: 53
Reputation: 787

Post » Sun Nov 17, 2013 3:26 pm

Yes, you're right. A shader would be the easiest solution to that. The disadvantage is that it consumes a lot of gpu power (drawing half of the screen pixel by pixel on every tick is quite some task). It might not run very well on mobile devices, at least on older tablets. But that's something you would have to test.
Beforehand, the best way would be to post in "help wanted". You are free to offer my effect as a base for a convertion to a C2 effect and the necessary adjustment to just the half of the screen.tulamide2013-11-17 15:26:52
Image
B
24
S
8
G
10
Posts: 1,821
Reputation: 8,279

Post » Sun Nov 17, 2013 3:28 pm

Wait... I was just testing the Rotate 180 thing and it works perfectly, no need to change any of the behaviors, gravity points up, controls are inverted, etc, I though it only rotated the layers but apparently Construct is that great and does the work for you. Awesome.
B
8
S
1
Posts: 53
Reputation: 787

Post » Sun Nov 17, 2013 5:20 pm

Rotating the entire layout seems to cause a really big framerate drop... On my computer it goes down to about 50%! But it does exactly what I was looking for, hopefully I'll be able to make the game more efficient so it works better in this situation.
B
8
S
1
Posts: 53
Reputation: 787

Post » Mon Nov 18, 2013 3:37 am

Did you try 2 half screens then compose all objects in one layer and rotate layer?
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,361


Return to How do I....?

Who is online

Users browsing this forum: Sparkz and 1 guest