Content Scaler for Unity
Hello there!
I have implemented content scaler (like uGUI Canvas) for unity with support of reference width and height and some types of width/height matching (without any MonoBehaviour watchers). May be it will be usefull to someone ^^
Link https://gist.github.com/LizzyFox-code/4 ... 98c74f2979.
How to use:
1. Add content scaler style to Application resources.
2. Add content scaler into xaml code.
I have implemented content scaler (like uGUI Canvas) for unity with support of reference width and height and some types of width/height matching (without any MonoBehaviour watchers). May be it will be usefull to someone ^^
Link https://gist.github.com/LizzyFox-code/4 ... 98c74f2979.
How to use:
1. Add content scaler style to Application resources.
2. Add content scaler into xaml code.
Code: Select all
<UserControl x:Class="Testing.TestScreen"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:scaling="clr-namespace:NoesisGUI.Extensions.Scaling">
<scaling:ContentScaler ReferenceWidth="1920" ReferenceHeight="1080" ContentMatchMode="MatchWidthOrHeight" MatchWidthOrHeight="0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="64"/>
</Grid.RowDefinitions>
</Grid>
</scaling:ContentScaler>
</UserControl>
-
-
sfernandez
Site Admin
- Posts: 2908
- Joined:
Re: Content Scaler for Unity
Thanks for sharing! It will be useful to others for sure.