private void AddGlyph() { _glyph = new GameObject("glyph", this.GameObj); Transform t = _glyph.AddComponent <Transform>(); t.RelativePos = new Vector3(0, 0, 0); t.RelativeAngle = 0; SkinnedPanel sp = new SkinnedPanel(); sp.VisibilityGroup = this.VisibilityGroup; sp.Skin = GlyphSkin; sp.Rect = Rect.AlignTopLeft(0, 0, GlyphSkin.Res.Size.X, GlyphSkin.Res.Size.Y); _glyph.AddComponent <SkinnedPanel>(sp); Scene.Current.AddObject(_glyph); }
private void AddBar() { _bar = new GameObject("bar", this.GameObj); Transform t = _bar.AddComponent <Transform>(); t.RelativePos = new Vector3(Rect.W / 2, Rect.H / 2, 0); t.RelativeAngle = 0; SkinnedPanel sp = new SkinnedPanel(); sp.VisibilityGroup = this.VisibilityGroup; sp.Skin = BarSkin; sp.Rect = Rect.AlignLeft(-Rect.W / 2 + Skin.Res.Border.X, 0, 0, Rect.H - Skin.Res.Border.Y - Skin.Res.Border.W); _bar.AddComponent <SkinnedPanel>(sp); Scene.Current.AddObject(_bar); }
private void AddHighlight() { _highlight = new GameObject("highlight", this.GameObj); Transform t = _highlight.AddComponent <Transform>(); t.RelativePos = new Vector3(Rect.W / 2, Rect.H / 2, DELTA_Z / 2); t.RelativeAngle = 0; _highlightPanel = new SkinnedPanel(); _highlightPanel.VisibilityGroup = this.VisibilityGroup; _highlightPanel.Skin = HighlightSkin; _highlightPanel.Rect = Rect.AlignTopLeft(0, 0, 0, 0); _highlightPanel.OverrideAutomaticZ = true; _highlight.AddComponent <SkinnedPanel>(_highlightPanel); Scene.Current.AddObject(_highlight); }