openfl / starling

Known as the "Cross-Platform Game Engine", Starling is a popular Stage3D framework for OpenFL and Haxe
Other
237 stars 68 forks source link

static juggler access #157

Closed loudoweb closed 3 years ago

loudoweb commented 3 years ago

Why this line is commented? https://github.com/openfl/starling/blob/master/src/starling/core/Starling.hx#L1273 Is it possible to uncomment this to make available a static access to the juggler?

jgranick commented 3 years ago

Unlike ActionScript 3.0, Haxe requires that local and static variables have distinct names from each other.

The ActionScript version of Starling has both an instance value called juggler and a static called juggler as well. The workaround now is to use Starling.current.juggler in place of Starling.juggler.

It could be possible to add a static reference as well, though with a different name. Sometimes I wonder if we should have let the name be used by the static version and renamed the instance version

loudoweb commented 3 years ago

You're right, using Starling.current is enough. Thanks