Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: bx83 on Tue 25/05/2021 12:00:08

Title: Is there a scrollable list box that I can put buttons/gfx in a GUI?
Post by: bx83 on Tue 25/05/2021 12:00:08
There’s a text list box with limited functionality, but I was wondering if there’s a scrollable canvas that I can put button and graphics on? For my graphical save games list.
Title: Re: Is there a scrollable list box that I can put buttons/gfx in a GUI?
Post by: Crimson Wizard on Tue 25/05/2021 12:04:11
No, but you could implement one by having a scroll position in a variable and moving all controls by offset, as controls are not drawn outside of GUI border.

If you want to emulate this "canvas" inside a larger GUI, so that only portion of it scrolls, then make it a separate transparent GUI positioned right over the "parent" one and place scrolled controls there.
Title: Re: Is there a scrollable list box that I can put buttons/gfx in a GUI?
Post by: bx83 on Wed 26/05/2021 01:16:09
So a separate gGUI-2 for the scrollable canvas with ZOffset=10, and a gGUI-1 with offset=9 to display the scrollable canvas on? Just wondering how to get a GUI the correct size.
Title: Re: Is there a scrollable list box that I can put buttons/gfx in a GUI?
Post by: Crimson Wizard on Wed 26/05/2021 01:28:04
Quote from: bx83 on Wed 26/05/2021 01:16:09
So a separate gGUI-2 for the scrollable canvas with ZOffset=10, and a gGUI-1 with offset=9 to display the scrollable canvas on? Just wondering how to get a GUI the correct size.

It's ZOrder, not zoffset, to be precise, but yes something like that.

Not sure I understand the question of the size, what is your situation?
Title: Re: Is there a scrollable list box that I can put buttons/gfx in a GUI?
Post by: bx83 on Wed 26/05/2021 02:27:54
I have gSaveLoad, which contains my 'portraits' of nine savegames. My total game window is only 1366x768 so it's hard or impossible to fit more (not to mention I have to add all 9 game controls manually, but that's another story, I'll go through your suggested code once I have this down).

So I will have to, I imagine:
-change gSaveLoad to gSaveCanvas, make it's 840x2000, add the extra savegame 'portraits', and make it's ZOrder=10
-make a new GUI, and use it to replace the smaller window (previous gSaveLoad), make it's ZOrder=9
-somehow figure out how to place one GUI on to another (presumably make them both visible, and then use the gSaveCanvas.Y and a scroll thing on the left to 'scroll' it up and down with the mouse wheel)
-???
-done

Does this sound accurate? How will the smaller border of the (new) gSaveLoad 'cover' the larger borders of gSaveCanvas if they're just one on top of the other?

(https://bluekeystudios.com/img/gsaveload.png)