Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

To be clear, I do have a clickable button, it’s just that I’m using a canvas so I can get the click event as well as the release event. I figured that, like regular buttons, it would be nice to support shortcuts as well as clicks.

I’m not currently targeting Web Decker, but it’s cool that getting key-down events is at least sometimes possible. Thanks for letting me know!

(+2)

I suspect the "hide offscreen" workaround may work for buttons inside contraptions too tbh, which keeps things a bit neater. If you set the position manually using the console you should be able to position it to be sure it's offscreen even if the contraption is up against a corner in the outside world.

It looks like it does! Thanks!

I had hoped I could check "card"=typeof card.parent to see if contraption was being used on a card (in which case, the button needs to be moved out of the way) or if the prototype was being edited (in which case, leave the button where it is so we can edit it). Unfortunately it seems like a prototype’s parent is always some card, even if that card does not contain any contraptions.

Still, if I really need to, I can still bring the button back on-screen by setting its position in the Listener.

(+2)

You can also use the Widgets -> Order... menu option to select from a text list of widgets (including any that may be hiding offscreen) so you can edit its script and properties without needing to actually see it

(+2)

If you really want to distinguish a prototype from a contraption, you could check the typeof "card" rather than "card.parent". There are other visible api differences, like contraption.def and prototype.widgets, but most of the time it's desirable for them to seem the same during prototype editing.