Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: eri0o on Mon 05/08/2019 01:27:56

Title: Resizable GUI, need API critic
Post by: eri0o on Mon 05/08/2019 01:27:56
Hello,

I made something to allow resizing a GUI like this:

(https://raw.githubusercontent.com/ericoporto/resizablegui/master/resizablegui_demo.gif)

To use, you need to create a TextGUI, in the example, this TextGUI is named gNinePieceExample, and add each image for it

(https://raw.githubusercontent.com/ericoporto/resizablegui/master/resizablegui_demo_editor.png)

It works like this, you need to set the GUI as resizable somewhere, like game start for the GUI you want

Code (ags) Select

gGui1.SetResizableProperties(
  ResizableGUI.Create(
    gNinePieceExample.AsTextWindow,
    /* horizontal resize graphic */ 1,
    /* vertical resize graphic */ 2,
    /* top left resize graphic */ 3,
    /* top right resize graphic */ 4,
    /* bottom left resize graphic */ 5,
    /* bottom right resize graphic */ 6,
    /* move cursor graphic */ 7,
    /* is click resizable */ true
  )
);


The Code and Example project is on GitHub (https://github.com/ericoporto/resizablegui).

I need help figuring out if this API makes sense or not. I want to use this with another thing I am making.
Title: Re: Resizable GUI, need API critic
Post by: Slasher on Mon 05/08/2019 06:02:56
Well, I'm not sure where you would use it but it looks great  (nod)
Title: Re: Resizable GUI, need API critic
Post by: eri0o on Mon 05/08/2019 18:53:20
Thanks Slasher! The use case I have in mind should be clearer soon. The two step build of property creation and attribution, is so one could apply the same properties in different GUIs easily.