public override void OnAwake() { base.OnAwake(); RectTransform.LayoutChanged += OnLayoutChanged; // Create parent container RectTransform.Size = new Point(170f, (Parent as UIElement).RectTransform.Height); Background.SliceType = SliceType.ThreeHorizontal; // container.Background.Source = ResourceManager.ImageFromFile(alignment == Alignment.Left ? AssetLibrary.UI.HeaderSlantedLeft : AssetLibrary.UI.HeaderSlantedRight); // Create inner container content = SceneObject.Instantiate <UIElement>(this); content.RectTransform.Size = new Point(RectTransform.Width - 60f, RectTransform.Height - 10f); // Properties that appear on either the left or right Properties = SceneObject.Instantiate <UIElement>(content); Properties.RectTransform.Size = new Point(content.RectTransform.Width, content.RectTransform.Height); PropertyName = Properties.AddComponent <Text>(); PropertyName.ApplyStyle(AssetLibrary.TextStyles.HudProperty); PropertyLabel = Properties.AddComponent <Text>(); PropertyLabel.ApplyStyle(AssetLibrary.TextStyles.HudValue); // Icon iconContainer = SceneObject.Instantiate <UIElement>(content); iconContainer.RectTransform.Size = new Point(20f, 20f); icon = iconContainer.AddComponent <Image>(); // Set default values PropertyName.Content = "LABEL"; PropertyLabel.Content = "0000"; }