Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

Hi, I was wondering if there was a way to re-order widgets on a card via script (the equivalent of the Widgets > Order feature). For example if I click on a draggable canvas partially covering/overlapping with another can it be promoted to the top of the pile? 

(1 edit) (+2)

You can inspect and modify the order of widgets on a card via their .index attribute, which counts from back to front, starting at 0. This is automatically clamped within the permissible range on a card, so assigning it to 0 or -1 can be a convenient shorthand for "all the way to the back" and any very large number (say, 999999) can likewise be used for "all the way to the front".

For example, you could give your draggable canvas a script like so:

on click do
 me.index:999999
end
(+1)

Thank you so much!