public virtual void Destroy()
        {
            // Generated Destroy
            SpriteManager.RemovePositionedObject(this);
            GuiManager.RemoveWindow(this);

            if (VictoryTextLabel != null)
            {
                VictoryTextLabel.Destroy();
                VictoryTextLabel.Detach();
            }
            if (PlayAgainText != null)
            {
                PlayAgainText.Destroy();
                PlayAgainText.Detach();
            }
            if (NoButton != null)
            {
                NoButton.Destroy();
                NoButton.Detach();
            }
            if (YesButton != null)
            {
                YesButton.Destroy();
                YesButton.Detach();
            }
            if (BackgroundSprite != null)
            {
                SpriteManager.RemoveSprite(BackgroundSprite);
            }


            CustomDestroy();
        }
// Generated AddToManagers
        public virtual void ReAddToManagers(Layer layerToAddTo)
        {
            LayerProvidedByContainer = layerToAddTo;
            SpriteManager.AddPositionedObject(this);
            GuiManager.AddWindow(this);
            SpriteManager.AddToLayer(PlayerSprite, LayerProvidedByContainer);
        }
示例#3
0
 public virtual void RemoveFromManagers()
 {
     SpriteManager.ConvertToManuallyUpdated(this);
     GuiManager.RemoveWindow(this);
     if (LabelText != null)
     {
         TextManager.RemoveTextOneWay(LabelText);
     }
 }
 public virtual void RemoveFromManagers()
 {
     SpriteManager.ConvertToManuallyUpdated(this);
     GuiManager.RemoveWindow(this);
     if (PlayerSprite != null)
     {
         SpriteManager.RemoveSpriteOneWay(PlayerSprite);
     }
 }
 public virtual void AddToManagers(Layer layerToAddTo)
 {
     LayerProvidedByContainer = layerToAddTo;
     SpriteManager.AddPositionedObject(this);
     GuiManager.AddWindow(this);
     SpriteManager.AddToLayer(PlayerSprite, LayerProvidedByContainer);
     AddToManagersBottomUp(layerToAddTo);
     CustomInitialize();
 }
示例#6
0
// Generated AddToManagers
        public virtual void ReAddToManagers(Layer layerToAddTo)
        {
            LayerProvidedByContainer = layerToAddTo;
            SpriteManager.AddPositionedObject(this);
            GuiManager.AddWindow(this);
            TextManager.AddToLayer(LabelText, LayerProvidedByContainer);
            if (LabelText.Font != null)
            {
                LabelText.SetPixelPerfectScale(LayerProvidedByContainer);
            }
        }
// Generated AddToManagers
        public virtual void ReAddToManagers(Layer layerToAddTo)
        {
            LayerProvidedByContainer = layerToAddTo;
            SpriteManager.AddPositionedObject(this);
            GuiManager.AddWindow(this);
            VictoryTextLabel.ReAddToManagers(LayerProvidedByContainer);
            PlayAgainText.ReAddToManagers(LayerProvidedByContainer);
            NoButton.ReAddToManagers(LayerProvidedByContainer);
            YesButton.ReAddToManagers(LayerProvidedByContainer);
            SpriteManager.AddToLayer(BackgroundSprite, LayerProvidedByContainer);
        }
 public virtual void RemoveFromManagers()
 {
     SpriteManager.ConvertToManuallyUpdated(this);
     GuiManager.RemoveWindow(this);
     VictoryTextLabel.RemoveFromManagers();
     PlayAgainText.RemoveFromManagers();
     NoButton.RemoveFromManagers();
     YesButton.RemoveFromManagers();
     if (BackgroundSprite != null)
     {
         SpriteManager.RemoveSpriteOneWay(BackgroundSprite);
     }
 }
示例#9
0
 public virtual void RemoveFromManagers()
 {
     SpriteManager.ConvertToManuallyUpdated(this);
     GuiManager.RemoveWindow(this);
     if (IconSprite != null)
     {
         SpriteManager.RemoveSpriteOneWay(IconSprite);
     }
     if (HighlightSprite != null)
     {
         SpriteManager.RemoveSpriteOneWay(HighlightSprite);
     }
 }
示例#10
0
        public virtual void Destroy()
        {
            // Generated Destroy
            SpriteManager.RemovePositionedObject(this);
            GuiManager.RemoveWindow(this);

            if (LabelText != null)
            {
                TextManager.RemoveText(LabelText);
            }


            CustomDestroy();
        }
        public virtual void Destroy()
        {
            // Generated Destroy
            SpriteManager.RemovePositionedObject(this);
            GuiManager.RemoveWindow(this);

            if (PlayerSprite != null)
            {
                SpriteManager.RemoveSprite(PlayerSprite);
            }


            CustomDestroy();
        }
示例#12
0
        internal override void DrawSelfAndChildren(Camera camera)
        {
            #region Draw the base
            base.DrawSelfAndChildren(camera);
            #endregion

            #region Prepare variables for the loop
            float yToUse = mWorldUnitY;

            float xToUse;

            StaticVertices[0].Position.Z     = StaticVertices[1].Position.Z = StaticVertices[2].Position.Z =
                StaticVertices[3].Position.Z = StaticVertices[4].Position.Z = StaticVertices[5].Position.Z =
                    camera.Z + FlatRedBall.Math.MathFunctions.ForwardVector3.Z * 100;

            StaticVertices[0].Color = StaticVertices[1].Color = StaticVertices[2].Color = StaticVertices[3].Color = StaticVertices[4].Color = StaticVertices[5].Color = mColor;
            #endregion

            foreach (Marker marker in markerArray)
            {
                if (marker.Value >= Start && marker.Value <= Start + ValueWidth)
                {
                    #region If the marker is using the default texture, set the texture coordinates appropriately
                    if (marker.Texture == null)
                    {
                        StaticVertices[0].TextureCoordinate.X = 0;
                        StaticVertices[0].TextureCoordinate.Y = .875f;

                        StaticVertices[1].TextureCoordinate.X = 0;
                        StaticVertices[1].TextureCoordinate.Y = .876f;

                        StaticVertices[2].TextureCoordinate.X = 0;
                        StaticVertices[2].TextureCoordinate.Y = .875f;

                        StaticVertices[5].TextureCoordinate.X = .001f;
                        StaticVertices[5].TextureCoordinate.Y = .876f;
                    }
                    #endregion

                    #region Else, the marker is using a custom texture, so add a texture switch and set the coordinates appropriately
                    else
                    {
                        GuiManager.AddTextureSwitch(marker.Texture);

                        StaticVertices[0].TextureCoordinate.X = 0;
                        StaticVertices[0].TextureCoordinate.Y = 1;

                        StaticVertices[1].TextureCoordinate.X = 0;
                        StaticVertices[1].TextureCoordinate.Y = 0;

                        StaticVertices[2].TextureCoordinate.X = 1;
                        StaticVertices[2].TextureCoordinate.Y = 0;

                        StaticVertices[5].TextureCoordinate.X = 1f;
                        StaticVertices[5].TextureCoordinate.Y = 1;
                    }
                    #endregion

                    xToUse =
                        (float)GetPosOnBar(marker.Value);

                    StaticVertices[0].Position.X = xToUse - marker.ScaleX;
                    StaticVertices[0].Position.Y = yToUse - marker.ScaleY;

                    StaticVertices[1].Position.X = xToUse - marker.ScaleX;
                    StaticVertices[1].Position.Y = yToUse + marker.ScaleY;

                    StaticVertices[2].Position.X = xToUse + marker.ScaleX;
                    StaticVertices[2].Position.Y = yToUse + marker.ScaleY;

                    StaticVertices[3] = StaticVertices[0];
                    StaticVertices[4] = StaticVertices[2];

                    StaticVertices[5].Position.X = xToUse + marker.ScaleX;
                    StaticVertices[5].Position.Y = yToUse - marker.ScaleY;

                    GuiManager.WriteVerts(StaticVertices);
                }
            }
        }