Howdy, Stranger!

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

on close

in Questions Posts: 324

does anyone remember what the call is for when codea is about to close?


  • edited June 17 Posts: 421

    It’s willClose() :smile:

    (bottom of ‘Display’ docs page)

  • Posts: 2,728
    @skar @steppers - just a little clarification please - why do you need a function like willClose() ?
  • Posts: 421

    @Bri_G Autosaving games is what immediately springs to mind for me.

  • Posts: 2,728

    @Steppers - thanks for that, kinda obvious really. Never thought about the need but nice to know it’s there.

  • Posts: 324

    yes, but for me i found i need this when i enable my repositioning mode, this allows me to change the location of my in game assets by dragging them around, if i
    forget to disable this mode and then close the project, i want all the new locations to be saved to a tab

    i’ve made this mistake a couple times now where i reposition things and then close the project, only to open it back up an realize i didn’t save any of my new positions

  • Posts: 324

    @Simeon on that note, it looks like willClose and saveProjectTab do not work well together always causing a crash, sometimes saving the data

    function willClose() saveProjectTab("Test", "local test = {}" ) end
Sign In or Register to comment.