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.
label renpy_:#(1,2)fc
#scene receta_generico
$ ren0 = ['{b}{size=+3}{u}Prueba Título {/u}{/size}{/b}',
'{size=-2}\nTEXTTTTTT XD{/size}'
'More text',
'\n{image=deco}\n', # <--- I add the image but it does not allow me to add text over it
'{u}subtitle nº 1{/u}: {a=lenguaje}see link content{/a}',
]
call screen renpai
screen renpai():
add "images/ren.png" pos (0,119)
text "{b}{size=+5}Link content {/size}{/b}" pos (78,67)
imagebutton:#
idle "images/cerrar.png"
hover "images/cerrar_h.png"
pos (1051,60)
focus_mask True
#activate_sound 'click.wav'
action Jump("renpy_")
frame:#documentación renpy
background None
area (320, 147, 870, 550) #(x, y, w, h)
viewport:
id "ren_0"
draggable True
scrollbars "vertical"
mousewheel True
has vbox
for i in ren0:
text i
the 'for' goes through all the content of $ren0. However what I want to do is to add a text over the image in the $ren0 block.I want to reuse the image several times. Is it possible?
Thank you in advance
Last edited by bonnie_641 on Tue Aug 03, 2021 1:46 pm, edited 1 time in total.
I speak and write in Spanish. I use an English-Spanish translator to express myself in this forum. If I make any mistakes, please forgive me.
I try my best to give an answer according to your question.
# Added the missing variable to make the request work (: (by hell_oh_world)
define disps = (
Text(""),
Fixed("deco", Text("\n Test text over image")) #<--- text over image (called deco) with line breaks and white spaces.
)
label renpy_:
#scene receta_generico
$ ren0 = ['{b}{size=+3}{u}Test Title {/u}{/size}{/b}',
'{size=-2}\nTEXTTTTTT XD{/size}'
'More text',
#'\n{image=deco}\n',
'{u}subtitle nº 1{/u}: {a=lenguaje}see link content{/a}',
]
call screen renpai
screen renpai():
add "images/ren.png" pos (0,119)
text "{b}{size=+5}Link content {/size}{/b}" pos (78,67)
imagebutton:
idle "images/cerrar.png"
hover "images/cerrar_h.png"
pos (1051,60)
focus_mask True
#activate_sound 'click.wav'
action Jump("renpy_")
frame:
background None
area (320, 147, 870, 550) #(x, y, w, h)
viewport:
id "ren_0"
draggable True
scrollbars "vertical"
mousewheel True
has vbox
for i in ren0:
text i
frame:
background None
for d in disps: #<------------- what you had on the screen of the previous post (thanks hell_oh_world)
add d # <3
PD: This code is linked to a local search engine. I only put in the part of the code that didn't work at all.
I speak and write in Spanish. I use an English-Spanish translator to express myself in this forum. If I make any mistakes, please forgive me.
I try my best to give an answer according to your question.