Flash sprite on screen

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
ChaiLatte
Newbie
Posts: 5
Joined: Thu Jan 27, 2022 2:01 pm
Contact:

Flash sprite on screen

#1 Post by ChaiLatte » Mon Feb 14, 2022 12:39 pm

Hi. I know you can flash white over the whole screen but my characters are displayed in a specific box on the screen and I ONLY want the flash to happen over that box. So I made a pain white image that's the size of that area and I want to flash this image on the screen and then immediately off again (perhaps with a fade effect to make it smoother). But I can't figure out how to do this. Can I display the image with dissolve, wait a ~0.5 sec, then have the image dissolve out, all while not pausing the text itself?

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3636
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Flash sprite on screen

#2 Post by Imperf3kt » Mon Feb 14, 2022 3:14 pm

Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py

User avatar
BioMa
Newbie
Posts: 9
Joined: Mon Apr 19, 2021 12:07 pm
Completed: Occult Rewrite
Deviantart: Biomacchia
itch: Biomacchia
Discord: Biomacchia#0578
Contact:

Re: Flash sprite on screen

#3 Post by BioMa » Mon Feb 14, 2022 6:11 pm

You can set up your image somewhere on the code and recall it anytime you need with a simple show command.
Do something like

Code: Select all

image flash_white:
    "/game/images/white_flash.png" with Dissolve (.5) #your image's filepath
    xpos *** # the X pos of the area you want to flash white at
    ypos *** # ditto for Y
    pause 0.5
    "/game/images/white_flash.png"
    xpos ***
    ypos ***
    pause 0.1
    "/game/images/clear.png" with Dissolve (.5) #This "clear" image is basically a completely transparent image that'll clear the last one for a smoother effect
    xpos ***
    ypos ***
    "
Bring it up on the main code with "show flash_white" anytime you want and it should have the effect you wish for, from what I've gathered.
Be sure to clear it with hide when appropriate afterwards.
The occult holds many mysteries. You'll find that 9 times outta 10 the answer to them can be lewd.
Check out Occult Rewrite, an Ero-Horror adventure game

Image

Post Reply

Who is online

Users browsing this forum: No registered users