So, I got a code for a message system here: viewtopic.php?f=51&t=19295
It's from 2013/2014 (kinda old). With the new gui system it looks like this:
I managed to do this:
I wanted to be like this:
When I change the code, instead of being fit inside the screen, the screen also resizes:
I don't want this, could someone help me out?
My code:
The Demo for the system, it's also on the original post.
Old message system [SOLVED]
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.
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.
- Potato0095
- Regular
- Posts: 84
- Joined: Sun May 08, 2016 8:40 pm
- Projects: LoveCraft
- itch: potato95
- Location: Brazil
- Contact:
Old message system [SOLVED]
Last edited by Potato0095 on Thu Jul 27, 2017 11:26 pm, edited 1 time in total.
"There are two types of lies: Lies that hurt, and lies that don't."
Re: Old message system
I don't know what your resolution is, so you'll have to fiddle with the numbers yourself, but it seems like you're having trouble with the area calculations and it might just be simpler to use an hbox and adjust xsize/ysize.
The following looks passably similar to your mockup on 1280x720.
The following looks passably similar to your mockup on 1280x720.
Code: Select all
screen mailbox:
tag menu
modal True
default current_message = None
$ available_drafts = [i for i in contacts if i.draft_label]
frame:
xalign 0.0 yalign 0.5
style_group "mailbox"
vbox:
label "Inbox"
if new_message_count() > 0:
text ("Messages: %d (%d unread)") % (message_count(), new_message_count())
else:
text ("Messages: %d") % message_count()
hbox:
side "c r":
xsize 500 # this
ysize 500 # this
viewport id "message_list":
draggable True mousewheel True
vbox:
for i in mail:
if i.view:
if not i.read:
textbutton ("*NEW* " + i.sender + " - " + i.subject) action [SetScreenVariable("current_message",i), i.mark_read] xfill True xalign 0.0
else:
textbutton (i.sender + " - " + i.subject) action SetScreenVariable("current_message",i) xfill True xalign 0.0
vbar value YScrollValue("message_list")
side "c r":
xsize 800 # this
ysize 500 # this
viewport id "view_message":
draggable True mousewheel True
vbox:
if current_message:
text ("From: " + current_message.sender)
text ("Subject: " + current_message.subject)
text current_message.body
vbar value YScrollValue("view_message")
use mailbox_commands
- Potato0095
- Regular
- Posts: 84
- Joined: Sun May 08, 2016 8:40 pm
- Projects: LoveCraft
- itch: potato95
- Location: Brazil
- Contact:
Re: Old message system
It worked, as you said, I had to put the numbers myself, since I'm using 1920x1080, it came out this way:
Thank you for your help, you saved me a lot of time here.
Code: Select all
hbox:
side "c r":
xsize 700 # this
ysize 600 # this
viewport id "message_list":
draggable True mousewheel True
vbox:
for i in mail:
if i.view:
if not i.read:
textbutton ("*NEW* " + i.sender + " - " + i.subject) action [SetScreenVariable("current_message",i), i.mark_read] xfill True xalign 0.0
else:
textbutton (i.sender + " - " + i.subject) action SetScreenVariable("current_message",i) xfill True xalign 0.0
vbar value YScrollValue("message_list")
side "c r":
xsize 1180 # this
ysize 600 # this
"There are two types of lies: Lies that hurt, and lies that don't."
Who is online
Users browsing this forum: Bing [Bot], Google [Bot], Wildmask