Esempio n. 1
0
 public virtual void ReAddToManagers(FlatRedBall.Graphics.Layer layerToAddTo)
 {
     LayerProvidedByContainer = layerToAddTo;
     FlatRedBall.SpriteManager.AddPositionedObject(this);
     FlatRedBall.Graphics.TextManager.AddToLayer(TextInstance, LayerProvidedByContainer);
     if (TextInstance.Font != null)
     {
         TextInstance.SetPixelPerfectScale(LayerProvidedByContainer);
     }
 }
Esempio n. 2
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);
            }
        }
Esempio n. 3
0
// Generated AddToManagers
        public virtual void ReAddToManagers(Layer layerToAddTo)
        {
            LayerProvidedByContainer = layerToAddTo;
            SpriteManager.AddPositionedObject(this);
            TextManager.AddToLayer(TextInstance, LayerProvidedByContainer);
            if (TextInstance.Font != null)
            {
                TextInstance.SetPixelPerfectScale(LayerProvidedByContainer);
            }
            SpriteManager.AddToLayer(SpriteInstance, LayerProvidedByContainer);
            ShapeManager.AddToLayer(mCollision, LayerProvidedByContainer);
        }
// Generated AddToManagers
        public override void AddToManagers()
        {
            TextManager.AddText(TextInstance); if (TextInstance.Font != null)
            {
                TextInstance.SetPixelPerfectScale(SpriteManager.Camera);
            }
            if (TextInstance.Font != null)
            {
                TextInstance.SetPixelPerfectScale(mLayer);
            }
            base.AddToManagers();
            AddToManagersBottomUp();
            CustomInitialize();
        }
Esempio n. 5
0
 public virtual void ReAddToManagers(FlatRedBall.Graphics.Layer layerToAddTo)
 {
     LayerProvidedByContainer = layerToAddTo;
     FlatRedBall.SpriteManager.AddPositionedObject(this);
     FlatRedBall.Graphics.TextManager.AddToLayer(ScorePoints, LayerProvidedByContainer);
     if (ScorePoints.Font != null)
     {
         ScorePoints.SetPixelPerfectScale(LayerProvidedByContainer);
     }
     FlatRedBall.Graphics.TextManager.AddToLayer(ScoreLabel, LayerProvidedByContainer);
     if (ScoreLabel.Font != null)
     {
         ScoreLabel.SetPixelPerfectScale(LayerProvidedByContainer);
     }
 }
Esempio n. 6
0
        public static Text AddText(string displayText, BitmapFont bitmapFont, string contentManagerName)
        {
            Text text = new Text(bitmapFont);

            text.ContentManager = contentManagerName;
            text.DisplayText    = displayText;

            text.AdjustPositionForPixelPerfectDrawing = true;

#if DEBUG
            if (mDrawnTexts.Contains(text))
            {
                throw new InvalidOperationException("Can't add the text to the Drawn Text list because it's already there.  This error is here to prevent you from double-adding Texts.");
            }
            if (mAutomaticallyUpdatedTexts.Contains(text))
            {
                throw new InvalidOperationException("Can't add the text to the Automatically Updated (Managed) Text list because it's already there.  This error is here to prevent you from double-adding Texts.");
            }
#endif

            mDrawnTexts.Add(text);
            mAutomaticallyUpdatedTexts.Add(text);

            text.SetPixelPerfectScale(SpriteManager.Camera);

            return(text);
        }
Esempio n. 7
0
		void CustomInitialize()
		{
            mText = TextManager.AddText("");
            mText.SetPixelPerfectScale(SpriteManager.Camera);

            
		}
Esempio n. 8
0
// Generated AddToManagers
        public override void AddToManagers()
        {
            BulletFactory.Initialize(BulletList, ContentManagerName);
            EnemyBulletFactory.Initialize(EnemyBulletList, ContentManagerName);
            TiledMap.AddToManagers();
            TileCollisionShapes.AddToManagers();
            PlayerInstance.AddToManagers(mLayer);
            EntityCollisionShapes.AddToManagers();
            EnemyCollisionGround.AddToManagers();
            TextManager.AddText(TheEndText); if (TheEndText.Font != null)
            {
                TheEndText.SetPixelPerfectScale(SpriteManager.Camera);
            }
            if (TheEndText.Font != null)
            {
                TheEndText.SetPixelPerfectScale(mLayer);
            }
            base.AddToManagers();
            AddToManagersBottomUp();
            CustomInitialize();
        }
Esempio n. 9
0
        public static Text AddText(string displayText, Layer layer)
        {
            if (layer == null)
            {
                return(AddText(displayText, DefaultFont));
            }
            else
            {
#if !SILVERLIGHT
                if (DefaultFont == null)
                {
                    throw new System.InvalidOperationException("Cannot create Text object because the TextManager's DefaultFont has not been set.");
                }
#endif
                Text text = new Text(DefaultFont);
                text.DisplayText = displayText;
                if (layer.CameraBelongingTo != null)
                {
                    text.SetPixelPerfectScale(layer.CameraBelongingTo);
                }
                else
                {
                    text.SetPixelPerfectScale(SpriteManager.Camera);
                }
                layer.Add(text);
                // Don't add the text to mDrawnTexts since it's drawn as part of the layer.

#if DEBUG
                if (mAutomaticallyUpdatedTexts.Contains(text))
                {
                    throw new InvalidOperationException("Can't add the text to the Automatically Updated (Managed) Text list because it's already there.  This error is here to prevent you from double-adding Texts.");
                }
#endif

                mAutomaticallyUpdatedTexts.Add(text);
                return(text);
            }
        }