Class ConstantPhysicalSize
A class that represents UnityEngine.UI.CanvasScaler.ScaleMode.ConstantPhysicalSize and its scaling properties.
Namespace: Mux.Markup
Assembly: Mux.Markup.UI.dll
Syntax
public class ConstantPhysicalSize : CanvasScaler.Modifier
Examples
<m:RectTransform
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:m="clr-namespace:Mux.Markup;assembly=Mux.Markup"
xmlns:mu="clr-namespace:Mux.Markup;assembly=Mux.Markup.UI"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:playground="clr-namespace:Mux.Playground;assembly=Assembly-CSharp"
x:DataType="playground:PlaygroundViewModel">
<!--
Note that you can use "using" scheme instead of "clr-namespace" to omit assembly
specification if:
- the referenced type is in an assembly already loaded. (interpreter)
- the referenced type is in the assembly containing the compiled XAML. (compiler)
-->
<mu:StandaloneInputModule />
<mu:Canvas />
<mu:CanvasScaler UiScale="{mu:ConstantPhysicalSize}" />
<mu:GraphicRaycaster />
<mu:Text Font="{Binding Path=Resources.Font}">
<mu:Text.Content>
You have to give property name "Path" to Binding only when you compile
the interpreter with IL2CPP. It is because ContentPropertyAttribute does
not work with IL2CPP.
> Using the Constant Physical Size mode, positions and sizes of UI elements are specified in physical units,
> such as millimeters, points, or picas.
Unity - Scripting API: UI.CanvasScaler.ScaleMode.ConstantPhysicalSize
https://docs.unity3d.com/ScriptReference/UI.CanvasScaler.ScaleMode.ConstantPhysicalSize.html
</mu:Text.Content>
</mu:Text>
</m:RectTransform>
Fields
| Improve this Doc View SourceDefaultSpriteDPIProperty
Backing store for the DefaultSpriteDPI property.
Declaration
public static readonly BindableProperty DefaultSpriteDPIProperty
Field Value
Type | Description |
---|---|
BindableProperty |
FallbackScreenDPIProperty
Backing store for the FallbackScreenDPI property.
Declaration
public static readonly BindableProperty FallbackScreenDPIProperty
Field Value
Type | Description |
---|---|
BindableProperty |
PhysicalUnitProperty
Backing store for the PhysicalUnit property.
Declaration
public static readonly BindableProperty PhysicalUnitProperty
Field Value
Type | Description |
---|---|
BindableProperty |
Properties
| Improve this Doc View SourceDefaultSpriteDPI
A property that represents UnityEngine.UI.CanvasScaler.defaultSpriteDPI.
Declaration
public float DefaultSpriteDPI { get; set; }
Property Value
Type | Description |
---|---|
Single |
FallbackScreenDPI
A property that represents UnityEngine.UI.CanvasScaler.fallbackScreenDPI.
Declaration
public float FallbackScreenDPI { get; set; }
Property Value
Type | Description |
---|---|
Single |
PhysicalUnit
A property that represents UnityEngine.UI.CanvasScaler.physicalUnit.
Declaration
public UnityEngine.UI.CanvasScaler.Unit PhysicalUnit { get; set; }
Property Value
Type | Description |
---|---|
UnityEngine.UI.CanvasScaler.Unit |
Methods
| Improve this Doc View SourceInitializeBodyInMainThread()
Declaration
protected override sealed void InitializeBodyInMainThread()