Page 1 of 1

[solved] Inventory Screen

Posted: Wed Jun 20, 2018 9:15 am
by Project_Astro
Hello everyone !
I feel really stupid to ask something like that but :

I found several tutorials about the Inventory system, which I didn't understand, for exemple :
viewtopic.php?f=8&t=50565&p=489377 (which is basically what I'm searching for)
or this viewtopic.php?f=51&t=23071

Well, I'm just trying to make a very simple Inventory screen where it shows you the item and the description of it. I don't need to add items, just a simple screen. And you would have a textbutton or something (I guess this is obvious) where you can click and it would lead you to thr inventory screen.
Could you help me ?

Thank you,

Re: Inventory Screen

Posted: Wed Jun 20, 2018 12:30 pm
by Project_Astro
Okay so I went with using a imagemap. My problem would be now :
how to include a textbutton (or somehting like that?) during all the game so the player would be able to consult this inventory screen when they want ?

Re: Inventory Screen

Posted: Wed Jun 20, 2018 1:44 pm
by Milkymalk
Just make a screen with a button:

Code: Select all

screen inventorybutton():
    textbutton "Inventory" xalign .95 yalign .05 action Show("inventoryscreen")
Show this screen and let it sit there.

Re: Inventory Screen

Posted: Wed Jun 20, 2018 2:24 pm
by Project_Astro
Yeah, that's what I was trying to do, and apparently it works !
Thank you very very much !

But could you explain to me why you add "()" after the screen's name ?

Re: [solved] Inventory Screen

Posted: Wed Jun 20, 2018 11:40 pm
by Milkymalk
You can call a screen with arguments, just like a function. I've been told that defining and calling a screen with arguments is faster than calling it without, even if it's an empty argument list, so I've made it a habit to include them.

Re: [solved] Inventory Screen

Posted: Thu Jun 21, 2018 9:03 am
by Project_Astro
Oh, okay, I think I've got it.
Thank you !