SDK changes for Timeline previews

0 favourites
  • 5 posts
From the Asset Store
Simplistic hyper-casual game with nature elements. Tap to switch between the 4 elements and reach a better score.
  • Release r359 adds a few missing methods for 3rd party plugins that need to preview timeline changes in the layout view. They are as follows:

    The editor SDK class, that's the object that exists in the SDK.Plugins."YOUR_PLUGIN_NAME".Instance namespace needs to implement the new OnTimelinePropertyChanged(id, value, detail) method which is pretty much the same as OnPropertyChanged(id, value), but it is called when a timeline is previewing changes. A brief description of the arguments:

    • "id" => The id of the property that is changing.
    • "value" => The value that is being applied by the timeline.
    • "detail" => an object with details about the value. It has a "resultMode" property with a value of either "absolute" or "relative".

    In that function the plugin needs to update the corresponding internal state, namely using the new GetTimelinePropertyValue(id) method from IObjectInstance which gets the value of a property with any changes a timeline might be applying to it. After the internal state is updated refresh the layout view to view the changes.

    Lastly, the plugin must implement the new method OnExitTimelineEditMode() which is called when timeline edit mode is turned off. In this method the plugin's internal state should be updated again so any timeline changes from the preview are reset. Using GetPropertyValue(id) to get values without timeline changes, applying those to the relevant internal variables of the plugin and refreshing the layout view should be enough.

    I hope this is useful to somebody else other than Mikal (I doubt it :D)

  • I hope this is useful to somebody else other than Mikal (I doubt it :D)

    This is super helpful, thanks for this feature!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for this.

    I hope it is useful to others too :)

    I imagine other addon devs just were not aware it was possible (e.g. didn't read the docs about it.)

    DiegoM - I replied in the github issue about sending the updated addon, which I would appreciate seeing, but no worries if it is a pain to do.

  • It's not a pain at all, I used the addon to fix the issue so I ended up adding the missing bits to it to check everything worked, I have it on my desktop.

    I asked Ash about your email, but he doesn't have it. Probably lost among all the things we have to do. You can email me at diegoexn@scirra.com and I'll reply to that.

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