renpy 8.0/7.5 Text() in Composite() is unseen

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
Li yuanlin
Regular
Posts: 88
Joined: Sat Aug 04, 2018 8:42 pm
Location: Hong Kong
Contact:

renpy 8.0/7.5 Text() in Composite() is unseen

#1 Post by Li yuanlin »

screenshot.png

Code: Select all

init python:
    def make_avatar(text,xsize=75,ysize=70):
        return Composite(
            (xsize ,ysize),
            (0, 0), Transform(Solid("#fffa"),xsize=xsize,ysize=ysize),
            (0 , ysize/2), Text(text,color="#aaa",size=15,xalign=.5,yalign=.5,font="SourceHanSansCN-Bold.otf")
            )

………

if current_collection[2] == "make_avatar":
	 add make_avatar(current_collection[0])

as the picture, same code at 7.4.11 and 8.0
stay hungry,stay foolish.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2400
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: renpy 8.0/7.5 Text() in Composite() is unseen

#2 Post by Ocelot »

Does this really not work in 7.5?

It probably doesn't work in 8.0 because of division changes (you need to write ysize//2 to get integer instead of floating point)
< < insert Rick Cook quote here > >

User avatar
Li yuanlin
Regular
Posts: 88
Joined: Sat Aug 04, 2018 8:42 pm
Location: Hong Kong
Contact:

Re: renpy 8.0/7.5 Text() in Composite() is unseen

#3 Post by Li yuanlin »

I see,got it,thanks for your reply.
stay hungry,stay foolish.

Post Reply

Who is online

Users browsing this forum: Google [Bot]