[SOLVED]How to color renpy.notify(str(num)) number?

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
johandark
Veteran
Posts: 356
Joined: Sat Apr 30, 2016 11:04 am
Completed: Wild Guards, In Dreams
Projects: Pact with a witch
Deviantart: johandarkweb
Location: Barcelona
Contact:

[SOLVED]How to color renpy.notify(str(num)) number?

#1 Post by johandark »

Code: Select all

default pf = PointFucker()

default pk = PointKeeper()

init python:        
    class PointFucker(object):
        def __init__(self):
            self.dp = 0
            
        def ch_dp(self, num):
            self.dp += num
            renpy.notify(str(num) + " {color=#6abd45}{size=12}DÍDAC POINTS!!{/size}{/color}")
            
    class PointKeeper(object):
        def __init__(self):
            self.np = 0
            
        def ch_np(self, num):
            self.np += num
            if num >= 0:
                renpy.notify(str(num) + " {color=#6abd45}{size=12}NEUS POINTS!!{/size}{/color}")
                
            else:
                renpy.notify(str(num), color=(200,255,255,80) + " {color=#ed2024}{size=12}NEUS POINTS!!{/size}{/color}")

With this code:

Code: Select all

                renpy.notify(str(num) + " {color=#6abd45}{size=12}NEUS POINTS!!{/size}{/color}")
I get this result:
green.jpg

Where "NEUS POINTS!!" is green, but the number is white.

I´ve tried use this:

Code: Select all

                renpy.notify(str(num), color=(200,255,255,80) + " {color=#ed2024}{size=12}NEUS POINTS!!{/size}{/color}")
But sadly didn´t work. (It´s not green color nor red, but it was a prove).

What am I doing wrong?

thanks!
Last edited by johandark on Sat Jul 23, 2016 1:03 pm, edited 1 time in total.
Image

User avatar
gas
Miko-Class Veteran
Posts: 842
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: How to color renpy.notify(str(num)) number?

#2 Post by gas »

The only thing that come to mind is that you're passing a color to the notify system, but notify use the default (white) if you dont put it inside a tag.

Take my words with caution, but experiment.
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.

10 ? "RENPY"
20 GOTO 10

RUN

User avatar
korova
Veteran
Posts: 217
Joined: Sat Jun 27, 2009 5:15 pm
Completed: Ivy, Chocolate, Time, Clair Obscur
Projects: Writing exercises, The House [Nano18]
Tumblr: korova08
itch: korova
Location: Normandie, France
Contact:

Re: How to color renpy.notify(str(num)) number?

#3 Post by korova »

What about this ?

Code: Select all

 renpy.notify("{color=#ed2024}{size=12}[num] NEUS POINTS!!{/size}{/color}") 
or

Code: Select all

 renpy.notify("{color=#ed2024}{size=12}" + str(num) +" NEUS POINTS!!{/size}{/color}") 
(Not home right now, I can't test)

User avatar
johandark
Veteran
Posts: 356
Joined: Sat Apr 30, 2016 11:04 am
Completed: Wild Guards, In Dreams
Projects: Pact with a witch
Deviantart: johandarkweb
Location: Barcelona
Contact:

Re: How to color renpy.notify(str(num)) number?

#4 Post by johandark »

korova wrote:What about this ?

Code: Select all

 renpy.notify("{color=#ed2024}{size=12}[num] NEUS POINTS!!{/size}{/color}") 
or

Code: Select all

 renpy.notify("{color=#ed2024}{size=12}" + str(num) +" NEUS POINTS!!{/size}{/color}") 
(Not home right now, I can't test)
The first Code doesn´t work, but the second one works perfectly!

THANKS!! ;)
Image

duck-and-wolf
Regular
Posts: 47
Joined: Thu Aug 29, 2019 6:20 pm
Completed: Head of the Class
Organization: Duck & Wolf
Contact:

Re: [SOLVED]How to color renpy.notify(str(num)) number?

#5 Post by duck-and-wolf »

This no longer works for me, has something about notifications changed in the intervening years?

Post Reply

Who is online

Users browsing this forum: No registered users