Page 1 of 1

Brightness in game settings

Posted: Fri Aug 26, 2022 9:25 am
by Andredron
Write this code first

Code: Select all

default persistent.brightvar = 0.0

init:
    transform bright:
        matrixcolor BrightnessMatrix((persistent.brightvar))
Further, for convenience, in the settings we will write a bar where you can change the values

Code: Select all

vbox:
    xsize 525
    label _("Brightness")
    bar value FieldValue(persistent, "brightvar", range=2.0, offset=-1, style="slider")

Registration of all code, check its performance

Code: Select all

default persistent.brightvar = 0.0

init:
    transform bright:
        matrixcolor BrightnessMatrix((persistent.brightvar))



label start:
    scene ball10 at bright
    "Hi"
    scene ball50 at bright
    "test"
     return
As you can see, the code works, but the problem is highlighted that a lot of unnecessary writing will have to be written, in order to avoid this, we will write such a function

Code: Select all

init python:
   def myShow( *args, **kwargs ):
        if not "at" in kwargs: kwargs["at_list"] = []
        kwargs["at_list"].append(bright )
        renpy.show( *args, **kwargs )
   config.show = myShow
Or:

https://www.reddit.com/r/RenPy/comments ... s_setting/