import{_ as s,c as i,o as a,ag as e}from"./chunks/framework.VBE0TPts.js";const g=JSON.parse('{"title":"Clickables","description":"","frontmatter":{},"headers":[],"relativePath":"public/gamedevtree/docs/clickables.md","filePath":"public/gamedevtree/docs/clickables.md"}'),t={name:"public/gamedevtree/docs/clickables.md"},l=e(`

Clickables

Clickables are any kind of thing that you can click for an effect. They're a more generalized version of Buyables.

DO NOT USE THESE TO MAKE THINGS THAT YOU CLICK REPEATEDLY FOR A BONUS BECAUSE THOSE ARE AWFUL.

There are several differences between the two. One is that a buyable's saved data is its amount as a Decimal, while Clickables store a "state" which can be a number or string, but not Decimal, array, or object). Buyables have a number of extra features which you can see on their page. Clickables also have a smaller default size.

You can get and set a clickable's state with getClickableState(layer, id) and setClickableState(layer, id, state). You can use clickableEffect(layer, id) to get the current effects of a clickable.

Clickables should be formatted like this:

js
    clickables: {
        rows: # of rows
        cols: # of columns
        masterButtonPress() // **optional** If this is present, an additional button will appear above the clickables.
                            // pressing it will call the function.
        masterButtonText: "Press me!" // **optional** text to display on the Master Button
        showMasterButton(){} //**optional**, a function determining whether or not to show the button. Defaults to true if absent.
        11: {
            display() {return "Blah"},
            etc
        }
        etc
    }

Features:

`,9),n=[l];function h(p,o,r,c,k,d){return a(),i("div",null,n)}const E=s(t,[["render",h]]);export{g as __pageData,E as default};