Resizable GUI, need API critic

Started by eri0o, Mon 05/08/2019 01:27:56

Previous topic - Next topic

eri0o

Hello,

I made something to allow resizing a GUI like this:



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



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

Code: ags

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.

I need help figuring out if this API makes sense or not. I want to use this with another thing I am making.

Slasher

Well, I'm not sure where you would use it but it looks great  (nod)

eri0o

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.

SMF spam blocked by CleanTalk