SWHolo : show images with a Star Wars-styled hologram effect

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Post Reply
Message
Author
Gouvernathor
Newbie
Posts: 23
Joined: Thu Aug 06, 2020 9:27 am
Github: Gouvernathor
Discord: Armise#6515
Contact:

SWHolo : show images with a Star Wars-styled hologram effect

#1 Post by Gouvernathor »

The purpose is to reproduce this effect https://www.gamingilluminaughty.com/wp- ... anKcaj.png - with tint, transparency, blinking and interlacing effects.
It renders as such :
Image

The project is here.

There are 6 parameters which control the behavior of the effect, which have default game-wide values but can also be customized for each instance of the effect.
  • tintcolor : the color used to tint the hologram. (default is #06f, a shade of blue)
  • totalpha : the overall transparency of the hologram. That's the most opaque any pixel of it will be visible. (From 0.0 being invisible to 1.0 being completely opaque, default is .9)
  • interalpha : the relative transparency applied every two lines to create the interlacing effect. It gets multiplied to the overall transparency. (default is .75)
  • blinking : the probability for every single frame to be a "blinking" (more transparent) frame. (From 0.0 being always more transparent to 1.0 being never more transparent, effectively disabling the blinking effect, default is .5)
  • blinkalpha : the relative transparency applied to the "blinking" frames. It gets multiplied with the overall transparency and the interlacing transparency for the affected lines. (From 0.0 being invisible to 1.0 being completely opaque, effectively disabling the blinking effect, default is .9)
  • lineheight : the height of the lines used in the interlacing effect, in pixels. (default is 4)
It's used through the holo transform. You can define your hologram as an image to show afterward, using image hologram = holo("beautifulcharacter angry"), or you can also directly show it using show expression holo("beautifulcharacter angry") as beautifulcharacter (I strongly recommand using the as clause). You can also apply it as a transform, with show beautiful as holo or show beautiful as renpy.curry(holo)(tintcolor='#f00') or even show layer master at holo.

Mutive
Veteran
Posts: 344
Joined: Tue Nov 21, 2017 2:23 am
Completed: Eidolon, Minion!, Love Furever, Epilogue
Contact:

Re: SWHolo : show images with a Star Wars-styled hologram effect

#2 Post by Mutive »

Oooh, this is super cool. :) I have no idea if I'll ever find an excuse to use it, but I love what you've done. :)
Enjoy Eidolon, my free to play game at: https://mutive.itch.io/eidolon, Minion! at: https://mutive.itch.io/minion or Epilogue at: https://mutive.itch.io/epilogue

Post Reply

Who is online

Users browsing this forum: No registered users