Is it possible to use this in the GUI layer somehow?
Shaun's Nine Slice
A downloadable asset pack
Update: Since GameMaker's latest version allows you to now natively build nine-slices, this code is somewhat obsolete! I have made this asset free to purchase for anyone using older versions such as 1.x, or anyone simply interested in the code.
Create boxes of arbitrary size based on any sprite partitioned into 9 even segments.
Sprites with minimum edge & center detail can use the "stretch" version to achieve precise / animated results.
Just two basic scripts, check out my free tutorial video and learn how to put this together yourself, avoiding any need to buy! (But if you liked it and the work I do, maybe consider buying it or supporting my work on Patreon!)
Click download now to get access to the following files: