Scripted Mirror Effect

Exhibition Scripted Mirror Effect V1

No permission to download
Projects meant as a technical demonstrator or instructional tutorial.
@Kratus, aren't screens the best? There's nothing you can't do with them! :)
@DCurrent Yeah certainly, scripted screens are amazing and have many different uses :)

The only thing that could improve the mirror effect using screens is a possible drawmethod engine update adding a "flipZ" effect, similar to "flipX / flipY" but for the Z axis. This way we can invert the Z movement in the mirror in case the modder wants (personally I prefer to not invert Z but for specific games this may look better).


Cool! Question: this method has the same bug of images which disappear like the native mirror?
@O Ilusionista Thanks buddy! No, the scripted mirror doesn't have the issue that causes the images to disappear.

After reading the source and doing some tests I discovered that the images disappear if you have any entity in the level that spawns beyond the minZ boundary, because the engine will use this value as reference to decide when to draw the mirror (there's a tolerance of -4 pixels). Due to this, the native mirror sometimes will force you to break your level design just to show the reflected images correctly.

The native mirror can even work well for simple levels but for very elaborated ones with enemies spawning beyond Z boundaries the scripted method works better and doesn't have the same limitations as the native, plus you don't need to change too many things in your level design.

The only thing that can affect your level design is in case you have other bglayers/background behind the mirror, like the image below. In this case the screen will be drawn behind the minZ (the glass) but in front of the background (the sky) but once the second screen used for the mirror adds a pure black color in all the empty spaces, the sky will be darkened.
1675191024423.png

In case you don't have any sprite using the pure black in your palette (rgb 0,0,0) you can easily solve this by adding the "transbg" drawmethod command in the mirror script, and then treating it as a transparent color causing to not be shown. In case you have pure black, you will need to manage the channel value using the alpha 6, this way you can reduce the "darkened" effect over the background.
 
Back
Top Bottom