MaterialUIScaler

Revision for “MaterialUIScaler” created on March 8, 2017 @ 06:02:35

Title
MaterialUIScaler
Content
The MaterialUIScaler is a component designed to replace or compliment Unity's CanvasScaler and help keep track of the scene's scaling settings. &nbsp; <a href="http://materialunity.com/wp-content/uploads/2016/08/materialuiscaler-inspector.png" rel="attachment wp-att-142"><img class="wp-image-200 aligncenter" src="http://materialunity.com/wp-content/uploads/2016/08/materialuiscaler-inspector.png" alt="" width="742" height="650" /></a> <p style="text-align: center;"> <span style="color: #999999;"><em>A <span style="color: #999999;">MaterialUIScaler</span> in the inspector.</em></span></p> <h1>Members</h1> [table] Member,Type,Description <strong>ScaleFactorChangeEvent,</strong>Delegate(float scaleFactor),Used as event to call when scaling is changed. <strong>OrientationChangeEvent,</strong>Delegate(Vector2 resolution),Used as event to call when orientation is changed. &nbsp; <strong>OnScaleFactorChange,</strong>ScaleFactorChangeEvent<strong>,</strong>Called when the scaling is changed. <strong>OnOrientationChange,</strong>OrientationChangeEvent<strong>,</strong>Called when the orientation is changed. &nbsp; <strong>targetCanvas</strong>,Canvas,The Canvas that the MaterialUIScaler is targeting. <strong>targetScaler</strong>,CanvasScaler,The CanvasScaler for the Canvas that the MaterialUIScaler is targeting. <strong>matchOrientationToScreen</strong>,bool,Should the CanvasScaler's reference resolution be swapped between portrait and landscape when the screen is? <strong>scaleFactor</strong>,bool,The scale factor of the Canvas (unlike the CanvasScaler\, this works in any scaling mode). [/table] <h1>Methods</h1> [table] Method,Type,Description <strong>GetParentScaler</strong>, static MaterialUIScaler (Transform transform), Gets the relevant (parent) MaterialUIScaler from any given Transform. [/table] <h1>Details</h1> Each root Canvas that contains MaterialUI elements will need to have a MaterialUIScaler attached, as it notifies the elements of changes in scaling in a performance-friendly way. The 'Match Orientation To Screen' feature is useful when designing UIs with both portait and landscape orientations, as it will flip the x and y values of the CanvasScaler's reference resolution (applicable only in 'Scale with screen size' mode) to match the screen's orientation (but not the values themselves, to preserve scaling) when a change is detected. Unless you're handling this yourself or otherwise modify the reference resolution, it's a good idea to keep this enabled. It is recommended to read the documentation on <a href="http://materialunity.com/documentation/design-patterns-and-practices/scaling/">Scaling Practices</a>.
Excerpt


OldNewDate CreatedAuthorActions
March 8, 2017 @ 06:02:35 admin
August 22, 2016 @ 16:23:43 admin
August 22, 2016 @ 13:03:47 [Autosave] admin
August 22, 2016 @ 12:58:19 admin
August 22, 2016 @ 12:58:03 admin
August 22, 2016 @ 12:57:30 admin
August 22, 2016 @ 12:46:24 admin
August 22, 2016 @ 12:45:55 admin
August 22, 2016 @ 12:45:45 admin
August 22, 2016 @ 12:44:56 admin
August 22, 2016 @ 12:44:07 admin
August 22, 2016 @ 12:43:53 admin
August 22, 2016 @ 12:40:43 admin
August 22, 2016 @ 12:40:25 admin
August 22, 2016 @ 12:39:51 admin
August 22, 2016 @ 12:35:30 admin
August 22, 2016 @ 11:31:48 admin
August 22, 2016 @ 11:31:13 admin
August 22, 2016 @ 11:26:28 admin
August 22, 2016 @ 11:25:19 admin
August 22, 2016 @ 11:22:05 admin
August 22, 2016 @ 11:21:14 admin
August 22, 2016 @ 11:17:53 admin