Fixing greyed out text? (SOLVED)

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
LittleRainySeasons
Regular
Posts: 44
Joined: Fri Mar 24, 2017 9:37 am
Projects: Patsy n' Crinkles, Galaxy Party, Time|Reversed
Deviantart: LittleRainySeasons
Soundcloud: RoboticDreamz
itch: LittleRainySeasons
Contact:

Fixing greyed out text? (SOLVED)

#1 Post by LittleRainySeasons »

So my code was working fine initially for the screens.

But when I removed the extra transparent PNG of one of the assets for the screens, all of the sudden the text were greyed out instead of white.

I did not touch any of the code except to modify the asset itself. Is there a way to fix this problem?
Last edited by LittleRainySeasons on Tue Nov 14, 2023 8:20 pm, edited 1 time in total.

User avatar
m_from_space
Eileen-Class Veteran
Posts: 1025
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: Fixing greyed out text?

#2 Post by m_from_space »

I think you have to provide more information here. Please post the code of the screen you mention and also what role this PNG plays within the screen.

User avatar
LittleRainySeasons
Regular
Posts: 44
Joined: Fri Mar 24, 2017 9:37 am
Projects: Patsy n' Crinkles, Galaxy Party, Time|Reversed
Deviantart: LittleRainySeasons
Soundcloud: RoboticDreamz
itch: LittleRainySeasons
Contact:

Re: Fixing greyed out text?

#3 Post by LittleRainySeasons »

m_from_space wrote: Sun Nov 12, 2023 6:27 am I think you have to provide more information here. Please post the code of the screen you mention and also what role this PNG plays within the screen.
Okay so this is the side menu where the player can access the map and look at the dates. This used to have an extra transparent PNG that fills up the whole screen.

Image

This was the code

Code: Select all

##Calendar
default week = 1
default day = 1

image menuweek = "gui/menuweek.png"
    
screen ingame_menu:
    add "gui/ingame_menu.png" xpos 597
    
    text "$[cash]" pos (625, 191) font "gui/PressStart2P-Regular.ttf" size (14)
    
    if week == 1:
        add "menuweek" pos (616, 117)
        text "SATURDAY" xalign 0.95 ypos 135 font "gui/PressStart2P-Regular.ttf" size (17)
        
    elif week == 2:
        add "menuweek" pos (616, 117)
        text "SUNDAY" xalign 0.93 ypos 134 font "gui/PressStart2P-Regular.ttf" size (17)
        
    elif week == 3:
        add "menuweek" pos (616, 117)
        text "MONDAY" xalign 0.93 ypos 135 font "gui/PressStart2P-Regular.ttf" size (17)
        
    elif week == 4:
        add "menuweek" pos (616, 117)
        text "TUESDAY" xalign 0.94 ypos 135 font "gui/PressStart2P-Regular.ttf" size (17)
        
    elif week == 5:
        add "menuweek" pos (616, 117)
        text "WEDNESDAY" xalign 0.958 ypos 135 font "gui/PressStart2P-Regular.ttf" size (16)
        
    elif week == 6:
        add "menuweek" pos (616, 117)
        text "THURSDAY" xalign 0.95 ypos 135 font "gui/PressStart2P-Regular.ttf" size (17)
        
    elif week == 7:
        add "menuweek" pos (616, 117)
        text "FRIDAY" xalign 0.93 ypos 135 font "gui/PressStart2P-Regular.ttf" size (17)
    
    imagebutton auto "gui/menumap_%s.png" xpos 616 ypos 225 focus_mask True action [ToggleScreen("map"), With(irisout)]
    imagebutton auto "gui/menusave_%s.png" xpos 711 ypos 545 focus_mask True action ShowMenu("save")
    imagebutton auto "gui/menuquit_%s.png" xpos 749 ypos 545 focus_mask True action Quit(confirm=True)

When the player goes to work, a screen pops up and this is the screen that will appear. The text is outside the screen where the textbox normally goes:

Code: Select all

screen workbox:
    add "gui/workbox.png" xpos 153 ypos 156
    
    text "$[earned_points]" pos (403, 172) font "gui/PressStart2P-Regular.ttf" size (14)
    
    if hour == 1:
        text "HOUR 1" pos (166, 173) font "gui/PressStart2P-Regular.ttf" size (13)
    
    elif hour == 2:
        text "HOUR 2" pos (166, 173) font "gui/PressStart2P-Regular.ttf" size (13)
    
    elif hour == 3:
        text "HOUR 3" pos (166, 173) font "gui/PressStart2P-Regular.ttf" size (13)
    
    elif hour == 4:
        text "HOUR 4" pos (166, 173) font "gui/PressStart2P-Regular.ttf" size (13)
    
    elif hour == 5:
        text "HOUR 5" pos (166, 173) font "gui/PressStart2P-Regular.ttf" size (13)
    
    elif hour == 6:
        text "HOUR 6" pos (166, 173) font "gui/PressStart2P-Regular.ttf" size (13)
        
screen buskwork:
    if busk == 1:
        add "buskanim" xpos 153 ypos 208
                    
        text "Your performance caught people's attention!" xpos 48 ypos 461 size (17)
        text "You earned $[earned]." xpos 48 ypos 482 size (17)
 
    elif busk == 2:
        add "buskanimnone" xpos 153 ypos 208
                
        text "Life was uneventful." xpos 48 ypos 461 size (17)
        
    use workbox
This used to look like this before changing the asset of the game menu:
Image

And this what happened after removing the extra PNG:
Image

But later I figured out that maybe it is after I updated Ren'Py since when I reverted the transparent PNG of the game menu, it's still greyed out.
Zorder also didn't work.

User avatar
LittleRainySeasons
Regular
Posts: 44
Joined: Fri Mar 24, 2017 9:37 am
Projects: Patsy n' Crinkles, Galaxy Party, Time|Reversed
Deviantart: LittleRainySeasons
Soundcloud: RoboticDreamz
itch: LittleRainySeasons
Contact:

Re: Fixing greyed out text?

#4 Post by LittleRainySeasons »

I must note that I made a work around by adding a transparent png for the text box as something temporary.

Although it feels it really doesn't solve my issue of the problem. (Because back then the text are above the default Ren'Py textbox and now it's behind it)

User avatar
m_from_space
Eileen-Class Veteran
Posts: 1025
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: Fixing greyed out text?

#5 Post by m_from_space »

LittleRainySeasons wrote: Mon Nov 13, 2023 10:12 pm But later I figured out that maybe it is after I updated Ren'Py since when I reverted the transparent PNG of the game menu, it's still greyed out.
Zorder also didn't work.
Yeah, I was wondering if a fully transparent PNG even has an effect on visuals. I'm not sure why your text is grey instead of white all of a sudden. Is there something half-transparent in front of it? Does the workbox.png contain a lot of half-transparent pixels that are drawn over the text maybe? Remember that things that you show first, will be drawn first.

By the way, you can shorten your code for this screen:

Code: Select all

screen workbox():
    add "gui/workbox.png" xpos 153 ypos 156
    
    text "$[earned_points]" pos (403, 172) font "gui/PressStart2P-Regular.ttf" size 14
    
    text "HOUR [hour]" pos (166, 173) font "gui/PressStart2P-Regular.ttf" size 13
Because back then the text are above the default Ren'Py textbox and now it's behind it.
The say screen (as any other screen) has a default zorder of 0. So if you want other screens to be drawn in front of it, give them a zorder larger than that.

User avatar
LittleRainySeasons
Regular
Posts: 44
Joined: Fri Mar 24, 2017 9:37 am
Projects: Patsy n' Crinkles, Galaxy Party, Time|Reversed
Deviantart: LittleRainySeasons
Soundcloud: RoboticDreamz
itch: LittleRainySeasons
Contact:

Re: Fixing greyed out text?

#6 Post by LittleRainySeasons »

Yeah, I was wondering if a fully transparent PNG even has an effect on visuals. I'm not sure why your text is grey instead of white all of a sudden. Is there something half-transparent in front of it? Does the workbox.png contain a lot of half-transparent pixels that are drawn over the text maybe? Remember that things that you show first, will be drawn first.
Well these are technically the workbox and the basic screen for the work animations. There's no other transparent pixels in it
Image

Image

The say screen (as any other screen) has a default zorder of 0. So if you want other screens to be drawn in front of it, give them a zorder larger than that.
I decided to put a zorder on the screens on where the work animation happens and finally it's fixed. I may have just misplaced the code while trying to solve it initially.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], RoiceDragonne