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.
-
Nero
- Veteran
- Posts: 242
- Joined: Tue Aug 09, 2016 2:59 pm
-
Contact:
#1
Post
by Nero » Sun Aug 20, 2017 3:55 pm
So lets say I got simple Textbutton that does nothing text inside it by default will be in center question is how do i move it around the textbutton area? Is that even possible? Like if i do xalign whole button will be moved obviously how to do it just for the text inside the textbutton?
Code: Select all
init python:
#This controls minimum button length
style.companionstats = Style(style.frame)
style.companionstats_button.xmaximum = 115
style.companionstats_button.xminimum = 115
Code: Select all
screen test:
frame:
style_group "companionstats"
xalign 0.500
yalign 0.500
vbox:
textbutton "BUTTON"
-
Remix
- Eileen-Class Veteran
- Posts: 1628
- Joined: Tue May 30, 2017 6:10 am
- Completed: None... yet (as I'm still looking for an artist)
- Projects: An un-named anime based trainer game
-
Contact:
#2
Post
by Remix » Sun Aug 20, 2017 5:17 pm
textbutton "Text" ... text_{any text style property} value
Text style properties
textbutton "Text" ... text_text_align 0.1
should move it left
or text_style style.some_var_you_set_in_gui
Note: Untested, just surmised from TextButton class. Also, that is new gui, so might not work on older versions
-
Nero
- Veteran
- Posts: 242
- Joined: Tue Aug 09, 2016 2:59 pm
-
Contact:
#3
Post
by Nero » Mon Aug 21, 2017 2:58 am
Tried it and it doesn't work :/ . In documentation it was really confusing for me to have property named "text_-" this "-" is clearly not needed there. This one looks like a Ren'Py bug by documentation "text_text_align 0.1" should be working
-
shin.e.d
- Newbie
- Posts: 22
- Joined: Sat Jan 10, 2015 10:50 am
- Projects: Data Lion and an unnamed bxb game with dinosaurs!
-
Contact:
#4
Post
by shin.e.d » Mon Aug 21, 2017 3:18 am
How about this?
Code: Select all
style x_button is frame:
xsize 315
style x_button_text:
xalign 0.0 yalign 0.5
screen x:
frame:
xalign 0.5 yalign 0.5
vbox:
style_prefix "x"
textbutton "button" action NullAction()
-
Nero
- Veteran
- Posts: 242
- Joined: Tue Aug 09, 2016 2:59 pm
-
Contact:
#5
Post
by Nero » Mon Aug 21, 2017 3:45 am
Ah finally it works thank you!
Still not sure why this what Remix said wont work even it is explained in documentation and by logic it should be working .
Users browsing this forum: Google [Bot]