Hi all,
Just wondering the best way to retrieve the project version from a plugin. Essentially the same value as the projectversion expression.
Cheers
I think you can access it via this.runtime.versionstr.
Ashley I've tried this, but it always returns undefined. I have no problem with any other this.runtime.* variables. I can even see it in the inspector, very confusing.
Which function are you trying to access it from? If you're in a closure or global function you'll need another way to get the runtime variable.
Develop games in your browser. Powerful, performant & highly capable.
Ashley this is from instanceProto.onCreate.
This returns undefined:
instanceProto.onCreate = function() { console.log(this.runtime.versionstr); }
Whereas this returns false as expected:
instanceProto.onCreate = function() { console.log(this.runtime.uses_background_blending); }
Any other this.runtime.* variables I've tried also work. I can't work out why versionstr is returning undefined, even though I can clearly see it as defined when doing console.log(this.runtime).