public Button() { SpriteFont font = Engine.Instance.Game.Content.Load<SpriteFont>("Arial"); _image = new Object2D(); _text = new TextWidget(font); _text.Text = ""; _image.DrawOrder= DrawOrder + 1; _text.DrawOrder = DrawOrder + 2; addComponent(_image); addComponent(_text); }
public void addComponent(Object2D component) { ObjectList.Add(component); if (component.ManualDepth) return; if (component is Layer ) component.LayerDepth = LayerDepth + DefaultEngineSettings.Engine_Layer_Layer_Depth_Step; else if (ObjectList.Count == 0) component.LayerDepth = LayerDepth + DefaultEngineSettings.Engine_Layer_Object_Depth_Step; else component.LayerDepth = this.LayerDepth + ObjectList.Last().LayerDepth + DefaultEngineSettings.Engine_Layer_Object_Depth_Step; Console.WriteLine("Layer Depth after add :" + component + " : depth : " + component.LayerDepth); }
//relativeLayerDepth = relative Depth public void addComponent(Object2D component, float relativeLayerDepth) { component.LayerDepth = this.LayerDepth + LayerDepth; addComponent(component); }
public void removeComponent(Object2D component) { ObjectList.Remove(component); }
public EffectShow(Object2D target) { Target = target; target.Visible = false; }