Addon SDK reference for "On Start of Layout" including the first layout.

  • Hi Ashley

    Is there an available event to listen for the On Start Of Layout that includes the first layout?

    I have the following below, but are only usable when changing layouts, not when starting the first layout.

     // Listeners
     this.GetRuntime().Dispatcher().addEventListener("beforelayoutchange", this.OnAfterLoad);
     this.GetRuntime().Dispatcher().addEventListener("afterload", this.OnBeforeLayoutChange);
     this.GetRuntime().Dispatcher().addEventListener("layoutchange", this.OnLayoutChange);
    

    Thank you.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • From the manual - are one of these what you are looking for?

    "beforelayoutstart"

    "afterlayoutstart"

    Fired when the layout starts. "beforelayoutstart" fires just before On start of layout, and "afterlayoutstart" first just after. In both events, all instances on the layout are created and available to modify.

    "beforeprojectstart"

    "afterprojectstart"

    Fired once only when the first layout in the project starts. "beforeprojectstart" fires before "beforelayoutstart" on the first layout, which in turn is before On start of layout triggers. "afterprojectstart" fires after "afterlayoutstart" on the first layout, which in turn is after On start of layout triggers. In both events, all instances on the first layout are created and available to modify.

  • Hi Mikal, I could be wrong, but aren't those only the Scripting Feature? I was hoping for an Addon SDK counterpart.

    Thanks.

  • Ah, no, you are right, I was thinking they could be used in both, but that may not be true. I have not tried it in the plugin SDK.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)