Inventory List, Show/Hide Item

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.
Post Reply
Message
Author
User avatar
Westeford
Regular
Posts: 151
Joined: Mon Jun 19, 2017 4:43 pm
Completed: 12 Hours to Die
Projects: Project Premonition
itch: westeford
Location: United States
Contact:

Inventory List, Show/Hide Item

#1 Post by Westeford »

I know this is a very common question, but whenever I look around for examples, they include additional things like money and stats that add to the complexity.

So my goal is this. To make a list of items. The items consist of a name, an image, and a description. The items are added to the list at certain points in the story.
When the player clicks on one of the item names, it shows the image and description in the frames.
Think Ace Attorney.

Here's my current code.

Code: Select all

screen inventory():
    tag menu
    use game_menu(_("Inventory")):
        vpgrid:
            cols 1
            spacing 5
            draggable True
            mousewheel True
            scrollbars "vertical"
            side_xalign 0.0
            for i in range(1, 2):
                frame:
                    textbutton _("Autopsy") xysize (300, 25):
                        if itemshow = false:
                            action Show("Autopsy")
                        else:
                            action Hide("Autopsy")
                            
        #Pic
        frame:
            xalign 1.0
            yalign 0.0
            xysize (250, 250)
        #Description
        frame:
            xalign 1.0
            yalign 1.0
            xysize (600, 300)
Here's what the screen looks like.
inventory screen.png
I appreciate any help and nudges. Thanks.
Last edited by Westeford on Wed Apr 18, 2018 4:12 pm, edited 3 times in total.

User avatar
Qlara
Regular
Posts: 80
Joined: Fri Nov 28, 2014 10:22 am
Completed: Carmilla
Skype: kantonija
itch: visualgothic
Location: Berlin
Contact:

Re: Inventory List Help Please

#2 Post by Qlara »

I've posted some code in this question that might give you an idea how to show the images and description.
viewtopic.php?f=8&t=49216
I have textbuttons on the left and hovering shows "chapentry" on the right (in my case label, text, image).
Ignore the many style definitions to get a rough idea.

User avatar
Westeford
Regular
Posts: 151
Joined: Mon Jun 19, 2017 4:43 pm
Completed: 12 Hours to Die
Projects: Project Premonition
itch: westeford
Location: United States
Contact:

Re: Inventory List Help Please

#3 Post by Westeford »

Qlara wrote: Sun Apr 15, 2018 5:20 pm I've posted some code in this question that might give you an idea how to show the images and description.
viewtopic.php?f=8&t=49216
I have textbuttons on the left and hovering shows "chapentry" on the right (in my case label, text, image).
Ignore the many style definitions to get a rough idea.
Thanks for the input.
Unfortunately I still have no idea what I'm looking at. :?

Post Reply

Who is online

Users browsing this forum: No registered users