[EFFECT] Flip Layout

This forum is currently in read-only mode.
From the Asset Store
Goodbye to sprite fonts, when you have something new on the anvil for your upcoming Games !
  • This effect flips a bunch of layers up to the entire layout.

    You need to use this effect as a layer effect and on a layer on its own!

    Without effect:

    <img src="http://dl.dropbox.com/u/11182740/construct/fliplayout1.png" border="0">

    With effect:

    <img src="http://dl.dropbox.com/u/11182740/construct/fliplayout2.png" border="0">

    Usage:

    1) Create a new layer (named "flipped" in this example)

    2) Apply the "Flip Layout"-effect to "flipped"

    Everything underneath that layer will then be drawn flipped on the "flipped"-layer (replacing everything that currently is on that layer, so always use a dedicated layer).

    The effect has 3 parameters:

    flip vertical

    flip horizontal

    activation

    Set any of those to 1.0 to switch them on. Any other value will switch them off.

    Note: Activation is there to make it more comfortable to edit your game. The effect will still add to GPU load, it just doesn't show the result. To save GPU load, deactivate the effect using the system actions.

    In edit time the effect will look offset, this is not an error. In runtime it will all be ok. Furthermore, the effect only works using a little trick: the colors have to be merged with a very small amount of the layer's color. It's only 0.001% though, so no human being will notice it. And last but not least the usual limitation for pixel shader effects: Windows elements like editboxes or buttons can't be altered, they'll stay at their positions (have a look at the pictures above)

    Download: Flip Layout.fx

  • Awesome! I have an effect made just for me! :)

    Joking aside, I love it. I have tried it and it happily satisfied my expectation. Now, I need to try to mix it up with some intense stuff going on.

    Thank you very much tulamide.

    edit:

    I did realized that the VRAM shot up quite a lot in comparison (w/ and w/o effect) and I hope it is not relatively proportionate to the original without the effect.

    In addition, I believe other might like to know this, but I noticed that movement is also flipped. So, what this effect seems to do is in fact literally mirror the layer(+all layers underneath) and their behaviours as well (NOTE: I have only tried it with horizontal flip and the 8-direction behaviour and pushing the object to go left made it turn around and go right like a drunken friend, and vice-versa).

  • Thanks a bunch Tulamide!

    aznmonkeyboy, I don't think an effect can modify behaviors. You may notice the mirrored movement because the view is flipped. I will give this a try.

    Edit: I can confirm this works as expected, the view itself is flipped rather than each object mirrored. Mirroring each individual object would be harder, unless they could all be grouped into families (and then each family is mirrored).

  • aznmonkeyboy, I don't think an effect can modify behaviors. You may notice the mirrored movement because the view is flipped. I will give this a try.

    I suppose I may have worded it to a point of misunderstanding. I was trying to say that this flip effect is rather akin to looking in a mirror sans text boxes and buttons.

  • Maybe I misunderstand it, but let me say two things about it:

    1) This is a pixel shader. All a pixel shader does is altering pixels when the graphic card is rendering. It does not change behaviors, coordinates and the like.

    2) flip horizontal and flip vertical do exactly what the functions in the picture editor do. When you imagine pixels as numbers then the effect (and the picture editor) do the following to the pixels:

    <font face="Courier New, Courier, mono">before: 01 02 03 04 05 06 07 08 09

    after:   09 08 07 06 05 04 03 02 01</font>

    If you intended to rather flip all sprite in its local coordinates while keeping the global coordinates on the layout, then you're lost, I'm afraid. This can't be done with only one shader. You'd need to use the "flip horizontal" and "flip vertical" effects (that come with CC) on every object instead. (EDIT: Or flip in code with families, as Jayjay described)

    But if I'm wrong, and your intention was something else that this effect does not achieve, could you do a drawing of what you have in mind?

  • Hello, I see the file .Fx, but you have the .xml Going with ?

    Thank you.

  • absolu Ah this is an effect for Construct Classic, the old open source tool before Construct 2 was made. C2 uses HTML5 and CC only uses DirectX 9, so the effect won't translate over properly as-is either <img src="smileys/smiley6.gif" border="0" align="middle" />

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ok,

    Thank you.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)