Code: Select all
screen invslots:
frame:
has vbox xalign 0.1 yalign 0.1
label "{size=38}Inventory{/size}"
text "[coins] Gold"
vbox:
for i in items:
imagebutton "images/inv/inv_%s.png" % i.icon action SetVariable("invtext", "")
null height 20
text invtext
hbox:
null width 300
textbutton "Close" action Return()
label invscreen:
call screen invslots
return
Code: Select all
File "game/screens.rpy", line 1581: expected a keyword argument, colon, or end of line.
imagebutton "images/inv/inv_%s.png" % i.icon action SetVariable("invtext", "")
Here is how I defined my item class:
Code: Select all
init python:
class Item:
def __init__(self, name, desc, icon=False, cost, qty=0):
self.name = name
self.desc = desc
self.icon = icon
self.cost = cost
self.qty = qty
def change(self, name, desc, icon=False, cost):
if name:
self.name = name
if desc:
self.desc = desc
if icon:
self.icon = icon
if cost:
self.cost = cost