Beispiel #1
0
        public virtual void InvalidateLayout()
        {
            if (!layoutValid)
            {
                return;
            }

            layoutValid = false;
            ParentLayer?.InvalidateLayout();
        }
Beispiel #2
0
        // ////////////////////////////// //
        //            Methods             //
        // ////////////////////////////// //

        /// Associate a new button with this base. If no other buttons have
        /// previously been associated, make it the default content.
        public void AddButton(T button)
        {
            if (AssociatedButtons.Count == 0)
            {
                SetDefault(button);
            }
            else
            {
                AssociatedButtons[button.ID] = button;
            }

            // bubble up the stack
            ParentLayer.AddButton(button);
        }
Beispiel #3
0
        protected override void OnStart()
        {
            var scene = new Scene();
            var layer = new ParentLayer();
            var obj   = new DisposingObject(layer);
            var obj1  = new TextureObject2D();
            var obj2  = new TextureObject2D();
            var obj3A = new TextureObject2D();
            var obj3B = new TextureObject2D();

            obj.AddChild(obj1, ChildManagementMode.RegistrationToLayer | ChildManagementMode.Disposal, ChildTransformingMode.Position);
            obj1.AddChild(obj2, ChildManagementMode.RegistrationToLayer | ChildManagementMode.Disposal, ChildTransformingMode.Position);
            obj2.AddChild(obj3A, ChildManagementMode.RegistrationToLayer | ChildManagementMode.Disposal, ChildTransformingMode.Position);
            obj2.AddChild(obj3B, ChildManagementMode.RegistrationToLayer | ChildManagementMode.Disposal, ChildTransformingMode.Position);

            scene.AddLayer(layer);
            layer.AddObject(obj);
            Engine.ChangeScene(scene);
        }
 public void Dispose()
 {
     GC.SuppressFinalize(this);
     ParentLayer?.RemoveChild(this);
 }
Beispiel #5
0
 public DisposingObject(ParentLayer layer)
 {
     this.layer = layer;
     Texture    = Engine.Graphics.CreateTexture2D(CloudTexturePath);
 }