Skip to content

Added static Starling.all property to get all Starling instances#527

Merged
PrimaryFeather merged 1 commit intoGamua:masterfrom
joshtynjala:all
Apr 22, 2014
Merged

Added static Starling.all property to get all Starling instances#527
PrimaryFeather merged 1 commit intoGamua:masterfrom
joshtynjala:all

Conversation

@joshtynjala
Copy link
Contributor

Similar to Starling.current, but it gets all Starling instances. An instance is added in its constructor and removed when its dispose() function is called.

Use Cases

  1. I have a reference to a starling.display.Stage. It would be nice if I could somehow get the starling.core.Starling instance that owns it. For instance, I might want to know the nativeStage that is associated with this Starling stage so that I can position something properly above Starling in an AIR NativeWindow. Looping through the vector returned by the static Starling.all property would allow me to find the right Starling instance pretty easily.

  2. An AIR NativeWindow has a stage property, which makes it easy to access the native display list of the active window with NativeApplication.activeWindow.stage. However, there's no way to get a Starling stage for an arbitrary NativeWindow. Similar to the previous use case, I can loop through the static Starling.all property and check if NativeApplication.activeWindow.stage matches a Starling instance's nativeStage property.

…is added in constructor and removed on dispose).
PrimaryFeather added a commit that referenced this pull request Apr 22, 2014
Added static Starling.all property to get all Starling instances
@PrimaryFeather PrimaryFeather merged commit 8698aa7 into Gamua:master Apr 22, 2014
@PrimaryFeather
Copy link
Contributor

I can see what you mean, Josh — yes, that makes sense! I merged that change into the master branch.

Thanks! 😄

@joshtynjala
Copy link
Contributor Author

Thank you, Daniel!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants