Blurred shadow based on game screen state

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
kostek00
Regular
Posts: 131
Joined: Wed Mar 28, 2018 5:54 pm
Contact:

Blurred shadow based on game screen state

#1 Post by kostek00 »

I have condition for shadows for text in textbox based of if game is in fullscreen or not (it needed that check because shadow was a bit too small in full screen and letting renpy scale it was giving me not so good effect).

This is condition in screen:

Code: Select all

    if preferences.fullscreen == True:
        $ fullscreen_offset = 1
    else:
        $ fullscreen_offset = 0
And this is added to text:

Code: Select all

outlines [(0, (0, 0, 0, 50), absolute(1 + fullscreen_offset), absolute(1 + fullscreen_offset)), (0, (0, 0, 0, 100), absolute(2 + fullscreen_offset), absolute(1 + fullscreen_offset)), (0, (0, 0, 0, 50), absolute(2 + fullscreen_offset), absolute(2 + fullscreen_offset))]
However I realised that I have used this effect in few more screens then just textbox and would like to use it there too but constantly repeating it is inefficient. Can I somehow make this condition check global and call this outlines as a single statement similar how you add style to text (text "some text" style 'blurred_text')?

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]