- Jun 10, 2017
- 11,009
- 16,295
[Note: don't mind my presence, it's just some brain works because its already 4AM and I need to stay awake.]
Because it's a property, not a method. I assume that the person who wrote the code did it because Ren'py don't deal with callable in its text substitution.
With @Epaddder you both saw part of the problem. He the missing quotes, you the "=". So in the end, this will also works:
same for this :
and this :
But here a problem with the last two solutions, because the day and time are numbers and not strings. So they need to be forced as string. Either at the source :
Or at the end point :
Finally, @EvilUser , there's no need to go full styling. The common part can be a defined style :
Or :
By example, if you add a "vbox" in the screen, either you create a "ngui_vbox" style that Ren'py will use, or Ren'py will use the default style for the vbox (style.vbox).
Uhm.... remove the -> () <- in the method I gave you and it works....
Code:
@property
def weekday(self):
With @Epaddder you both saw part of the problem. He the missing quotes, you the "=". So in the end, this will also works:
Code:
text "[clock.weekday]" size 36 color "#ffffff" font "agencyb.ttf" xpos 20 ypos 50
Code:
text clock.weekday size 36 color "#ffffff" font "agencyb.ttf" xpos 20 ypos 50
Code:
[...]
# @property
def weekday( self ):
[...]
text clock.weekday() size 36 color "#ffffff" font "agencyb.ttf" xpos 20 ypos 50
Code:
[...]
@property
def time(self):
return str( self.time_of_day[0] )
@property
def today( self ):
return str( self.day )
Code:
text str( clock.day ) size 32 color "#ffffff" font "agencyb.ttf" xpos 120 ypos 90
Code:
style ngui_text is default:
size = 32
color = "#fff"
font = "agencyb.ttf"
[...]
text "[clock.weekday]" style "ngui_text" xpos 20 ypos 50
Code:
style ngui_text is default:
size = 32
color = "#fff"
font = "agencyb.ttf"
screen ngui:
style_prefix "ngui"
[...]
text "[clock.weekday]" xpos 20 ypos 50
You must be registered to see the links
is a screen property that will define the prefix for the style of all the elements of the screen. The style need to be formatted like this "[prefix]_[name of the screen statement]" ; so, here "ngui_text". Then Ren'py will automatically apply the right style to the elements of the screen, or the default style if there's no specific style.By example, if you add a "vbox" in the screen, either you create a "ngui_vbox" style that Ren'py will use, or Ren'py will use the default style for the vbox (style.vbox).