Bug? One screen is in different colour than others

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
Lezalith
Regular
Posts: 82
Joined: Mon Dec 21, 2015 6:45 pm
Contact:

Bug? One screen is in different colour than others

#1 Post by Lezalith » Wed Jul 13, 2016 6:47 pm

So, I've been asking alot about statements. This time, however, I found something that might actually be worthy of being in this thread.

I have a screen. That screen consists of a bar, some text statements and a white image (Interface and all drawn in that .png image). It's not actually white ingame, however, it is gray.
And I found out that's not an issue with the picture.
If I paint some red into the image, ingame it's way more dark and gray-ish than the image actually is.
Those text statements have some {color}s, and those colors are also more gray than their hex color is.

I'ts been happening only with this one particular screen. I tried removing the bar (as this is the only screen with bar I currently have in my code), didn't help.
The way you get to this screen is the same that you get to the other screens.

Code: Select all

screen A:
    button:
        action Jump(Label)

label Label:
    call screen B
The only ONLY difference is that screen B is preceded by some math with variables, but I tried removing those too, and you guessed it, that didn't help either.
I ALSO tried putting a white image before calling the screen, but that white image is ALSO grey.
I thought, "maybe the screen B is covered by leftovers of some other screen?", so I set a high zorder in screen B, didn't help. I also tried setting it low, and the screen was still gray the same way, so it can't be covered up by another screen.
A fun (Well, not so much for me) fact: After exiting that screen, this grey-ness is over!
One more fun (?) fact: Pictures of the bar (Left_bar and Right_bar) are white images, and they ARE white as they should be.

I just tried using a different image instead of the "white interface". I used a image that is an interface for a different screen. On that different screen, it's completely normal. However, when I put it in the EXACT spot in the code where "white interface" image is supposed to be, it's gray too!

I don't know what kind of magic is this, but anybody has any idea what is causing this?

Edit: Also, forgot to mention, when I move my cursor out of the game window (I don't have it in fullscreen) on that particular screen, it goes even more gray. Like "lights out" style. That isn't happening on other screens either.

User avatar
78909087
Veteran
Posts: 277
Joined: Sat Aug 16, 2014 2:33 pm
Completed: Dungeons and Don't Do It, Wake Up
Projects: Lethe
IRC Nick: Pacermist
Contact:

Re: Bug? One screen is in different colour than others

#2 Post by 78909087 » Thu Jul 14, 2016 11:02 am

I can't promise I'll know how to fix this, but could you start by posting the code you're using for the screen?
It'll help anyone else looking into your problem help you.
(Remember to use the code display to differentiate it!)
I am not friends with the sun.
Image

User avatar
Lezalith
Regular
Posts: 82
Joined: Mon Dec 21, 2015 6:45 pm
Contact:

Re: Bug? One screen is in different colour than others

#3 Post by Lezalith » Thu Jul 14, 2016 8:48 pm

(Just a clarification, no, in the actual file, the screen is not after the label. I just put it here in order in which it is used. Also, the conditional branch in "label TeachingDoneMorning" is 250 lines, but it's basically copy-paste with 3 different words, so I just put a single part of it here.)

Code: Select all

    showif MorningSelected == 1 and AfternoonSelected == 1:    
        imagebutton: 
            idle "teachingButton.png"
            hover "teachingButton.png"
            xpos 1064
            ypos 199
            action Show("emptyBranch"),Jump("TeachingDoneMorning"),Hide("study")

label TeachingDoneMorning:
    if InTeachingMorning == "Persuation":                # Communication
        $ skillValueOld = PersuationValue
        $ MoodAffection = (MoodAngry + MoodHappy)
        $ TeachingPoints = (MoodAffection + 6)*1.66667
        $ PersuationValue = (skillValueOld + TeachingPoints)
        $ PersuationValue = round(PersuationValue, 3)
        $ skillValueNew = PersuationValue
    call screen teaching_done_morning

screen teaching_done_morning:
    tag mains
    zorder 10
    add "TeachingDone.png" xalign 0.5 yalign 0.5
    text "{color=#e86b6b}[InTeachingMorning]{/color}" xpos 52 ypos 58 yalign 1
    text "{color=#e86b6b}Puvodne [skillValueOld]{/color}" xpos 200 ypos 415
    text "{color=#e86b6b}Nyni [skillValueNew]{/color}" xpos 700 ypos 415
    button at x3 action Jump("TeachingDoneAfternoon"),Hide("teaching_done_morning")
    bar:
        xpos 321
        ypos 12
        value AnimatedValue(value=skillValueNew, old_value=skillValueOld, delay=2, range=100)
        range 10
        xmaximum 930
        ymaximum 52
        left_bar Frame("barFull.png", 10, 0) 
        right_bar Frame("barEmpty.png", 10, 0) 
        thumb None
That imagebutton is part of a screen, of course. As soon as that imagebutton is pressed, the issue appears. I tried putting more pictures after the "label TeachingDoneMorning" and before the "call screen teaching_done_morning", but no, they are grey aswell.

Code: Select all

label TeachingDoneAfternoon:
    if InTeachingAfternoon == "Persuation":                # Communication
        $ skillValueOld = PersuationValue
        $ MoodAffection = (MoodAngry + MoodHappy)
        $ TeachingPoints = (MoodAffection + 6)*1.66667
        $ PersuationValue = (skillValueOld + TeachingPoints)
        $ PersuationValue = round(PersuationValue, 3)
        $ skillValueNew = PersuationValue
    call screen teaching_done_afternoon

screen teaching_done_afternoon:
    tag mains
    zorder 10
    add "TeachingDone.png" xalign 0.5 yalign 0.5
    text "{color=#e86b6b}[InTeachingAfternoon]{/color}" xpos 52 ypos 58 yalign 1.0
    text "{size=+4}{color=#e86b6b}[skillValueOld]{/color}{/size}" xpos 77 ypos 694 yalign 1.0
    text "{size=+4}{color=#e86b6b}[skillValueNew]{/color}{/size}" xpos 374 ypos 694 yalign 1.0
    button at x3 action Jump("main_screen"),Hide("teaching_done_morning")
    bar:
        xpos 321
        ypos 12
        value AnimatedValue(value=skillValueNew, old_value=skillValueOld, delay=2, range=100)
        range 10
        xmaximum 930
        ymaximum 52
        left_bar Frame("barFull.png", 10, 0) 
        right_bar Frame("barEmpty.png", 10, 0)
        thumb None
You can notice that "Label TeachingDoneAfternoon" and "screen teaching_done_afternoon" are same as their "morning versions", they just use a single different variable. Because I want to show the entire issue here however, I'm posting it aswell.
In "screen teaching_done_afternoon", there is a button that takes you to "main screen".

Code: Select all

label main_screen:
    call screen main_screen

screen main_screen:
    tag mains
    imagemap:
        ground "MainScreen.png"
        hotspot (1100, 35, 200, 100) action Show("skills", transition=dissolve) 
        hotspot (1102, 232, 200, 100) action Show("mood", transition=dissolve) 
        hotspot (1100, 460, 200, 100) action Show("study", transition=dissolve) 
And that's it. As soon as you press that button that takes you to "screen main screen", the issue is over and "screen main screen" is back in normal. Also, this process can be looped. In game, you could infinitely repeat going through all these screens (Well, discount one button that gets you from "screen main screen" to "labe teaching_done_morning, but that's not important). And no matter how many times I will go through all those screens, the issue will still be in that same spot.

I hope I covered everything. It's alot of code, but it's just basic statements. Also, I posted everything that somehow relates to my issue to show that it IS basic stuff, there's not really anything there that could be even remotely causing my issue (Or atleast I hope so, would be embarrasing -.-' ).

User avatar
Lezalith
Regular
Posts: 82
Joined: Mon Dec 21, 2015 6:45 pm
Contact:

Re: Bug? One screen is in different colour than others

#4 Post by Lezalith » Sat Jul 16, 2016 3:24 pm

Found it out today when I was working on a different screen... The button causes this. The position where button is, "x3", is just xpos and ypos, it doesn't limit the button in any way.

It means that button was on the entire screen. Also, when you hover over a button, it lights up a bit, that's why it went dark when I put my cursor out of the game window.

Welp, atleast it's solved.

Post Reply

Who is online

Users browsing this forum: Google [Bot], _ticlock_