Difference between revisions of "DeviceOrientationDetector"

From Headbone Creative
Jump to: navigation, search
(Initial page, includes API information and categories)
 
(Updating API info)
Line 1: Line 1:
This script keeps track of the current [http://en.wikipedia.org/wiki/Aspect_ratio_(image) aspect ratio] of the screen. When the aspect ratio changes, it sends out an event using the [[Messenger]] system.  
+
This script keeps track of the current [http://en.wikipedia.org/wiki/Aspect_ratio_(image) aspect ratio] of the screen. When the aspect ratio changes, it notifies all [[DeviceOrientationListener]]s in the scene. There only needs to be one of these in the scene.
  
== Public Variables ==
+
== Public Functions ==
=== orientationChangedMessage : string ===
+
=== void FindAllListeners () ===
This is sent along with a float indicating the current aspect ratio.  
+
This is called on [http://docs.unity3d.com/Documentation/ScriptReference/MonoBehaviour.Start.html Start] to find all listeners in the scene. It can be called at other times if new listeners are added after the scene begins.  
  
 
[[Category:API]]
 
[[Category:API]]
 
[[Category:Mobile]]
 
[[Category:Mobile]]
 
[[Category:Premium Scripts]]
 
[[Category:Premium Scripts]]

Revision as of 02:10, 17 April 2013

This script keeps track of the current aspect ratio of the screen. When the aspect ratio changes, it notifies all DeviceOrientationListeners in the scene. There only needs to be one of these in the scene.

Public Functions

void FindAllListeners ()

This is called on Start to find all listeners in the scene. It can be called at other times if new listeners are added after the scene begins.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox