Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
 //relativeLayerDepth = relative Depth
 public void addComponent(Object2D component, float relativeLayerDepth)
 {
     component.LayerDepth = this.LayerDepth + LayerDepth;
     addComponent(component);
 }
Example #4
0
 public void removeComponent(Object2D component)
 {
     ObjectList.Remove(component);
 }
Example #5
0
 public EffectShow(Object2D target)
 {
     Target = target;
     target.Visible = false;
 }