Skip to main content

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

I'd like to make a button that operates similarly to using ctrl+z on a keyboard,  my initial thought is:

on click do danger.js["undo()"] end

However...

Directly calling internal Decker functions is not advised, as these do not necessarily represent a stable API; prefer passing Lil functions into JS to allow it to manipulate the Decker environment whenever possible.

I'm assuming this part of the reference is referring to what I'm trying to do here, but if that's the case, how would I go about doing it properly?

If Decker itself doesn't have APIs for doing something, and you're willing to constrain an application to only work in web-decker, calling internal functions via danger.js[] may be the only way to make it happen; I just reserve the right to change those internal functions in the future.

I'm a bit puzzled by the specific example you're raising, though. Clicking a button widget to fire a script takes place while in "interact" mode, whereas the internal "undo()" function in web-decker is part of the apparatus used in "widget" and drawing tool modes. Can you provide some broader context for what you're trying to do?

(+1)

Compared to decks like tour.html, Patternshop Cinnamon runs really poorly on my phone. In an attempt to make a more mobile-friendly version, I cut down any cosmetic widgets and significantly shrunk the deck size down. The menu bar is hidden by default to save on space, but I kept the toolbars visible. Given the lack of keyboard and menu bar, there's no way to undo or redo from within the deck - That's where my current road block lies.