[SOLVED] how to put lil images before the text on this screen?

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
ninjaK4T_06
Newbie
Posts: 6
Joined: Fri Nov 30, 2018 6:19 am
Contact:

[SOLVED] how to put lil images before the text on this screen?

#1 Post by ninjaK4T_06 »

I'm using this post to make random characters, and I made a screen thingy to view all the characters generated. I want to put images before the characters names, but when I try to add them, it just puts the image above the text like this???

Whenever I try to manually position the image using xpos and ypos, it doesn't show. also, if i try to use align, it won't overlap the "line" the text is on and therefore won't go before the text where i want it to be :(

Here's the I'm using btw

Code: Select all

side "c r":
        area (280,50,1000, 600)
        viewport id "character screen":
            mousewheel True
            vbox:
                for c in random_characters:
                    showif c.gender == "male":
                        add "images/gender male.png" yalign 1
                    else:
                        add "images/gender female.png" yalign 1 
                        
                    text "{} {} from {}, {} years old. Trained for {} {}".format (c.name, c.surname, c.nationality, c.age, c.trainee, c.period) 
            
                    
        vbar value YScrollValue("character screen")
so yeah, that's my problem. any tips on how to fix this wuold be much appreciated :D
Last edited by ninjaK4T_06 on Fri Jan 04, 2019 1:10 am, edited 1 time in total.

User avatar
SONTSE
Regular
Posts: 96
Joined: Sun Nov 24, 2013 10:49 pm
Completed: 11 VN's so far
Discord: jkx0282_10798
Contact:

Re: how to put lil images before the text on this screen?

#2 Post by SONTSE »

Try adding 'hbox:' after 'for' line, like this:

Code: Select all

side "c r":
        area (280,50,1000, 600)
        viewport id "character screen":
            mousewheel True
            vbox:
                for c in random_characters:
                    hbox:
                        showif c.gender == "male":
                            add "images/gender male.png" yalign 1
                        else:
                            add "images/gender female.png" yalign 1 
                        
                        text "{} {} from {}, {} years old. Trained for {} {}".format (c.name, c.surname, c.nationality, c.age, c.trainee, c.period) 
            
                    
        vbar value YScrollValue("character screen")

ninjaK4T_06
Newbie
Posts: 6
Joined: Fri Nov 30, 2018 6:19 am
Contact:

Re: how to put lil images before the text on this screen?

#3 Post by ninjaK4T_06 »

Lena_Borodach wrote: Thu Jan 03, 2019 1:39 pm Try adding 'hbox:' after 'for' line, like this:

Code: Select all

side "c r":
        area (280,50,1000, 600)
        viewport id "character screen":
            mousewheel True
            vbox:
                for c in random_characters:
                    hbox:
                        showif c.gender == "male":
                            add "images/gender male.png" yalign 1
                        else:
                            add "images/gender female.png" yalign 1 
                        
                        text "{} {} from {}, {} years old. Trained for {} {}".format (c.name, c.surname, c.nationality, c.age, c.trainee, c.period) 
            
                    
        vbar value YScrollValue("character screen")
Wow I can't believe it was that easy to solve ! :D Thank you very much for your help ^_^

Post Reply

Who is online

Users browsing this forum: Google [Bot]