textadventures / squiffy

a tool for creating interactive fiction
MIT License
158 stars 37 forks source link

Using new 'get' method #41

Closed pzolla closed 9 years ago

pzolla commented 9 years ago

If I run the attributes example using native Squiffy and use browser console:

$("#squiffy").squiffy("get", "story")

returns null. If I make the squiffy variable global and run

squiffy.story

the object is returned.

I had similar result when testing for 'squiffy.ui.settings.persist'.

alexwarren commented 9 years ago

Those are not attributes! Get and set are for game state, they access the same values as squiffy.set and squiffy.get.

The JavaScript squiffy object is hidden from external JavaScript by design. If you want to access it, your current approach of moving it to the global scope is correct. On 21 Feb 2015 14:48, "pzolla" notifications@github.com wrote:

If I run the attributes example using native Squiffy and use browser console:

$("#squiffy").squiffy("get", "story")

returns null. If I make the squiffy variable global and run

squiffy.story

the object is returned.

I had similar result when testing for 'squiffy.ui.settings.persist'.

— Reply to this email directly or view it on GitHub https://github.com/textadventures/squiffy/issues/41.