Skip to main content

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

Hello! I have a draggable canvas that I would like to toggle from interact mode. I have tested this with a canvas and two buttons. The first button is scripted as follows:


on click do

 canvas1.draggable:"true"

end


This acts as intended, making the canvas draggable. The second button is meant to make it NOT draggable. I attempt this with the following script:

on click do

 canvas1.draggable:"false"

end


When this button is pressed, the canvas is still draggable; in fact, I have learned that any text in quotes (ex. "beedeebadoo" or "shoobyflooby") will still make the canvas draggable. What would the proper syntax be to make the canvas no longer draggable via a scripted event?

Thank you!! Big fan of your work :)

(1 edit) (+2)

In Lil, the number 0, the empty string "", nil, the empty list (), or an empty dictionary is considered false and anything else is considered true. Most of the time, 1 and 0 are the clearest way to indicate true or false, respectively.

Your examples should probably be

on click do 
 canvas1.draggable:1
end

and

on click do
 canvas1.draggable:0
end

Does that make sense?

(+2)

Ah! I totally thought I had already tried using null, that works!! Thank you for your gifts O Wise One