Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

sugarcube 2: What is the difference between widgets and macros?

What is the difference (if any) between widgets and macros?

Thank you!

Comments

  • edited June 2017
    Widgets are macros.

    Widgets are written and defined in twine script, while other "standard" macros are written in JavaScript. The widget macro automates the process of creating a macro, but limits your ability to use certain features; for example if you want to create a macro that has child tags, like <<if>> and <<else>>, you're usually better off just making a macro in JavaScript.

    Generally, I'd say widgets should be used as shortcuts to save time on writing code that you use a lot, while standard macros should be used to extend or add functionality.

    Which one you use when both would work is down to preference and confidence working in JavaScript.
  • Thanks, Chapel!
Sign In or Register to comment.