Tuesday

Ren'Py Forum Community

Playing around with Python coding was quite stressful at times due to areas of coding which needed to be placed in certain segments of the scripts. However, the Ren'Py forum community has a lot of excitingly useful and satisfying aid that eases my learning curve.

Below is a code segment that I wanted to implement into my visual novel. It basically takes the background art image and then inverts its colours. This can cause an eerie appearance if made right as well as resembling that of a lightning strike which my scripting has a couple of.

init python:

def invert():
srf = screenshot_srf()
inv = renpy.Render(srf.get_width(), srf.get_height()).canvas().get_surface()
inv.fill((255,255,255,255))
inv.blit(srf, (0,0), None, 2) #pygame.BLEND_RGB_SUB enum is 2
return inv


Skull217, Team Salvato. (2017) DDLCtVN effects.rpy. Available from: https://github.com/Skull217/DDLCtVN/blob/master/effects.rpy [Accessed: 22nd January 2018]