Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

How to prevent swiping to next Decker card on mobile browser?

A topic by nyoomian created Aug 08, 2024 Views: 197 Replies: 2
Viewing posts 1 to 2
(5 edits) (+2)

Hello! Coding/scripting newbie here. I use Decker for a little interactive thing for my webcomic, which you can check out here and also here.

Some readers on mobile told me that they could swipe outside of the Decker window or along the edges, causing a black arrow to show up at the top and it sends them to hidden cards. You can see it at the top right corner here:

I keep these extra white cards to store dialogue, backup drawings, or stuff I plan to include in the future, since I update the Decker file a lot as my webcomic goes on. I don’t want readers to see these cards because of potential spoilers so, is there a way to remove the ability to swipe through cards? 

But also, I have little to no coding/scripting knowledge, maybe there’s a better way I don’t know of for hiding code/sprites instead of keeping a lot of cards behind-the-scenes?  I thought of just making the dialogue stuff invisible, but I don’t know how to go about that for the drawings. Tips are appreciated!

Also thank you Internet Janitor for creating and maintaining Decker! It’s so awesome! :D

Developer(+1)

I'm thrilled that you're having fun with Decker; using it for nonlinear supplementary material for a webcomic is a really cool idea!

Swiping generates "navigation gestures", which are the touchscreen-accessible equivalent to navigating the deck with the cursor keys. By default, Decker includes this handler for navigate[] events:

on navigate x do
 if x~"right" go["Next"] end
 if x~"left"  go["Prev"] end
end

If you want to disable this, edit the deck-level script (File -> Properties... -> Script...) and add an empty handler:

on navigate do end

Note that while in Widgets mode or using any drawing tools you'll still be able to navigate between cards with left/right cursor keys; overriding navigate[] disables this functionality while in Interact mode.

There are, of course, other things one could do by overriding navigate[], like setting up fancy 2d movement through the deck or even making keyboard-based puzzle games!

Does that make sense?

(+1)

Yes it makes sense! Thank you so much, I’ll try to disable it using the method you gave. Also setting up a keyboard-based puzzle game sounds cool, will definitely consider something like that in the future too!