Whenever I try to use the search here the page just won't load and will act as if I have no internet connection.
With Google I haven't gotten that far either.
Alright this time my question should be less of a hassle.
I have a "simple" inventory system.
The player can hold 3 items in total.
I edited my initial question since I managed to get that stuff to work HOWEVER.
This last part is a mystery to me.
library.rpy
Code: Select all
default carry = 0
Code: Select all
$ items = []
$ vial = item("Vial", "assets/items/vial_min.png", "assets/items/vial_min_hover.png", "A vial, no idea what is in it.")
if carry < 3:
$ items.append(vial)
$ carry += 1
Code: Select all
init python:
class item:
def __init__(self, name, picture, Hover, description):
self.name = name
self.picture = picture
self.Hover = Hover
if description == "":
self.description = "Item."
else:
self.description = description
screen description:
hbox:
text i.name
xalign 0.5
ypos 370
hbox:
text i.description
xpos 445
ypos 406
screen inventory_screen:
modal True
add "gui/overlay/inv_bg.png"
imagebutton:
idle "gui/button/inventory.png"
hover "gui/button/inventory_hover.png"
xpos 10
ypos 10
action Hide("inventory_screen")
grid 3 1:
spacing 35
xpos 455
ypos 125
for i in items:
imagebutton:
idle i.picture #if I switch this one with i.Hover it shows i.Hover
hover i.Hover
hovered Show("description")
unhovered Hide("description")
for i in items:
null
null
As if it doesn't see the imagebutton.
Adding the links of the pages I visited:
Topic 1
Topic 2
Topic 3 that features way too many things that I don't need and I tried to dissect it but got stuck
Topic 4
Thanks in advance once again and I am sorry for the dumb questions I am asking.
How it got solved:
Code: Select all
imagebutton:
idle i.picture
hover i.Hover
hovered Show("description", i=i)
unhovered Hide("description")
action NullAction()