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.
-
span4ev
- Regular
- Posts: 77
- Joined: Fri Jul 08, 2022 9:29 pm
- itch: rpymc
-
Contact:
#1
Post
by span4ev » Sat Jul 09, 2022 8:20 pm
Is it possible to style the grid through a prefix or directly?
Let's say I have a frame that has a grid. And I want to make one background for the whole frame and another for different grids.
Is it possible? Or does the grid not provide styling options?
Code: Select all
screen statsDetail():
style_prefix 'statsDetail'
frame:
background '#21293a'
margin(120, 10)
grid 2 3:
# xspacing 10
text 'Anna`s love'
text '[anna_love]'
text 'Anna`s affection'
text '[anna_affc]'
text 'Anna`s friendship'
text '[anna_affc]'
Last edited by
span4ev on Sat Oct 15, 2022 5:03 am, edited 1 time in total.
-
Ocelot
- Eileen-Class Veteran
- Posts: 1883
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
-
Contact:
#2
Post
by Ocelot » Sun Jul 10, 2022 3:00 am
Technical answer:
yes, grid supports common, positionat and grid style properties. You can apply any of properties from those style groups either directly of through defining a style.
Actually useful answer:
grid is a type of layout, an element which exist only to constrain placement of its children, like *box or viewport, or side , or fixed... So, by itself it does not support many visible properties. You need to make it a child of another element which supports - in your case - window style properties. Generally it is frame: place a grid inside of frame and set background for the frame.
< < insert Rick Cook quote here > >
-
span4ev
- Regular
- Posts: 77
- Joined: Fri Jul 08, 2022 9:29 pm
- itch: rpymc
-
Contact:
#3
Post
by span4ev » Sun Jul 10, 2022 3:59 am
Ocelot wrote: ↑Sun Jul 10, 2022 3:00 am
Technical answer:
yes, grid supports common, positionat and grid style properties. You can apply any of properties from those style groups either directly of through defining a style.
Actually useful answer:
grid is a type of layout, an element which exist only to constrain placement of its children, like *box or viewport, or side , or fixed... So, by itself it does not support many visible properties. You need to make it a child of another element which supports - in your case - window style properties. Generally it is frame: place a grid inside of frame and set background for the frame.
Thank you!