Skip to main content

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

Here's an at-a-glance selection of some ways to refer to different kinds of stored data in basic widgets, using attributes:

Buttons: .value (boolean true/false)

Fields: .text (plain text) .value (rich text) .data (LOVE data) or .images (images only) 

(it's a little visually chaotic but an interactive example of the difference between these four can be found here)

Canvases: .copy[] and .paste[]

Sliders: .value (the number it's currently set to)

Grids: .value (for the whole table), .rowvalue and .cellvalue

---

And to refer to a .value attribute of a widget on the same card:

widgetname.value

Or to refer to a .value of a widget on another card:

othercardname.widgets.widgetname.value

And if things have less script-friendly names you can refer to them with square brackets:

deck.cards["Silly Card Name"].widgets["I'm a Widget"].value

---

I hope this helps point you in the right direction!

Hi!

Is it the same with contraptions ? I'm new to decker and currently struggling to access "values" of a enum contraption (which allows to show text in a slider) 

When I use ".value", it blocks the slide action, but ".text" doesn't seem to work either...

The enum contraption exposes its string value through a .value attribute. Internally, like any contraption, this is handled by get_value[] and set_value[].

I think you're going to need to describe more about what you're trying to do- and especially show the scripts you're trying to use- for us to diagnose what's going wrong.

(+1)

Thank you for your answer!! 

the command was : if me.value=croquettes (etc)

I forgot the " " (it is a string...) 

So with : if me.value="croquettes", it works !