Couldn’t find any existing topics where this question was asked. I’m working on a few popups with existing “flyouts,” where we currently have a button script that toggles the width of a window between an “expanded” and “collapsed” dimension. We accomplish this with the window.size property (roughly) as follows:
flyout = event.source.parent.FlyoutActive window = event.source.parent.parent.parent.parent titlebarHeight = event.source.parent.parent.parent.parent.titlebarHeight if(flyout == 0): window.size = (800, 400+titlebarHeight) event.source.parent.FlyoutActive = 1 else: window.size = (400, 400+titlebarHeight) event.source.parent.FlyoutActive = 0
This works for our purposes, but we would love to use a smoother transition (similar to system.gui.transform) to make this feel more natural and less jerky. Since system.gui.transform only works on components and not windows directly, this isn’t as easy to do.
I’ve toyed with the idea of a delay loop and resizing the window one or two pixels at a time, but that feels a little hacky:
if(flyout == 0):
stepWidth = collapsedWidth
while stepWidth < expandedWidth:
stepWidth = stepWidth + 1
window.size = (stepWidth,alwaysHeight)
event.source.parent.FlyoutActive = 1
Does anyone have any clever ideas or suggestions?