How can I add an event listener to a value change specifically for numbers? Say x = 20 and I have a button that changes x = 40. How would I capture that event? (Not for TextLayers, specifically integers)
layer.on „change:x“ ->
create only function that changes your x so you can know when it changes?
Layer.on “change:x”, ->I think.
but that's just catching the x-value change right? screenshot below to explain better:
Oh! So not the property „x“ but the change of the value of a variable called x 🤦♂️
Hm. So maybe really a function? Or a custom event emitter.
Yea :/ "change:x" only applies to layers as well, not variables.
you can write a function to check if num is 0 or not and turn on visibility based on that. My code isn't the best, so I'm sure there's a cleaner way to do this https://screencast.com/t/QH5sVCju5f0
That's what you're after there... The code snippet in Steve Ruiz Cyclops code will allow you to have custom events for any parameter...