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.
apoto
Newbie
Posts: 22 Joined: Thu Apr 26, 2018 11:32 am
Contact:
#1
Post
by apoto » Sat May 25, 2019 11:30 pm
I'm Trying to make a button with text and image but I keep failing
Code: Select all
image text_start:
text _("Begin"):
size 28
font"SourceHanSerifSC-Heavy.otf"
color"#FFFFFF"
image button_start = Composite(
(216, 82),
(0,0), "gui/launch_page/button.png",
(54,30), "text_start")
Imperf3kt
Lemma-Class Veteran
Posts: 3794 Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:
#2
Post
by Imperf3kt » Sun May 26, 2019 4:42 am
Use an imagebutton and add text to the foreground states
Code: Select all
screen my_screen() :
fixed:
imagebutton:
idle "gui/launch_page/button.png"
hover "gui/launch_page/button.png"
idle_foreground Text("{size=28}{font=SourceHanSerifSC-Heavy.otf}Begin{/font}{/size}" , xalign=0.5, yalign=0.5)
hover_foreground Text("{size=28}{font=SourceHanSerifSC-Heavy.otf}Begin{/font}{/size}" , xalign=0.5, yalign=0.5)
action Start()
I'd suggest using a style though instead of inline styles.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project:
GGD Mentor
Twitter
apoto
Newbie
Posts: 22 Joined: Thu Apr 26, 2018 11:32 am
Contact:
#3
Post
by apoto » Sun May 26, 2019 12:49 pm
Imperf3kt wrote: ↑ Sun May 26, 2019 4:42 am
Use an imagebutton and add text to the foreground states
Code: Select all
screen my_screen() :
fixed:
imagebutton:
idle "gui/launch_page/button.png"
hover "gui/launch_page/button.png"
idle_foreground Text("{size=28}{font=SourceHanSerifSC-Heavy.otf}Begin{/font}{/size}" , xalign=0.5, yalign=0.5)
hover_foreground Text("{size=28}{font=SourceHanSerifSC-Heavy.otf}Begin{/font}{/size}" , xalign=0.5, yalign=0.5)
action Start()
I'd suggest using a style though instead of inline styles.
Thank you very much!!!!
Users browsing this forum: Google [Bot]