public override void Initialize(bool addToManagers)
        {
            // Generated Initialize
            LoadStaticContent(ContentManagerName);
            LayerInstance = new FlatRedBall.Graphics.Layer();
            LayerInstance.Name = "LayerInstance";
            CharacterCreationUIEntityInstance = new WinterEngine.Game.Entities.CharacterCreationUIEntity(ContentManagerName, false);
            CharacterCreationUIEntityInstance.Name = "CharacterCreationUIEntityInstance";

            base.Initialize(addToManagers);
        }
Esempio n. 2
0
 public virtual void ReAddToManagers(FlatRedBall.Graphics.Layer layerToAddTo)
 {
     LayerProvidedByContainer = layerToAddTo;
     FlatRedBall.SpriteManager.AddPositionedObject(this);
     FlatRedBall.SpriteManager.AddToLayer(Sprite, LayerProvidedByContainer);
 }
 public virtual void ReAddToManagers(FlatRedBall.Graphics.Layer layerToAddTo)
 {
     LayerProvidedByContainer = layerToAddTo;
     FlatRedBall.SpriteManager.AddPositionedObject(this);
     FlatRedBall.Math.Geometry.ShapeManager.AddToLayer(mAxisAlignedRectangleInstance, FlatRedBall.SpriteManager.TopLayer);
 }
 public override void AddToManagersBottomUp(FlatRedBall.Graphics.Layer layerToAddTo)
 {
     base.AddToManagersBottomUp(layerToAddTo);
 }
Esempio n. 5
0
 public virtual void AddToManagersBottomUp(FlatRedBall.Graphics.Layer layerToAddTo)
 {
     AssignCustomVariables(false);
 }
Esempio n. 6
0
 public void AddSpritesToLayers(FlatRedBall.Graphics.Layer darknessLayer, Layer hudLayer)
 {
     base.AddSpritesToLayers(darknessLayer, hudLayer);
 }
Esempio n. 7
0
 public virtual void ReAddToManagers(FlatRedBall.Graphics.Layer layerToAddTo)
 {
     LayerProvidedByContainer = layerToAddTo;
     FlatRedBall.SpriteManager.AddToLayer(this, layerToAddTo);
     FlatRedBall.SpriteManager.AddToLayer(BackgroundSprite, LayerProvidedByContainer);
 }
Esempio n. 8
0
        public virtual void MoveToLayer(FlatRedBall.Graphics.Layer layerToMoveTo)
        {
            var layerToRemoveFrom = LayerProvidedByContainer;

            LayerProvidedByContainer = layerToMoveTo;
        }
        public override void MoveToLayer(FlatRedBall.Graphics.Layer layerToMoveTo)
        {
            var layerToRemoveFrom = LayerProvidedByContainer; // assign before calling base so removal is not impacted by base call

            base.MoveToLayer(layerToMoveTo);
        }
Esempio n. 10
0
        private static Texture2D GenerateRadiusTexture(int maxRange, int minRange)
        {
            // Determine the new layer size
            var newTextureHeight = maxRange * 2;
            var newTextureWidth  = maxRange * 2;

            // This layer holds whatever we want drawn
            var temporaryLayer = new Layer();

            // Define the layer.
            var renderTarget = new RenderTarget2D(
                FlatRedBallServices.GraphicsDevice,
                newTextureWidth,
                newTextureHeight);

            temporaryLayer.RenderTarget = renderTarget;

            var maxRangeSprite = new Sprite
            {
                Texture        = RangeCircleTexture,
                TextureScale   = newTextureHeight / (float)RangeCircleTexture.Height,
                ColorOperation = ColorOperation.ColorTextureAlpha,
                Z     = 0,
                Red   = 0,
                Green = 255,
                Blue  = 0,
            };

            SpriteManager.AddToLayer(maxRangeSprite, temporaryLayer);

            var minRangeSprite = new Sprite
            {
                Texture      = MinRangeCircleTexture,
                TextureScale = minRange * 2 / (float)MinRangeCircleTexture.Height,
                //ColorOperation = ColorOperation.Subtract,
                ColorOperation = ColorOperation.ColorTextureAlpha,
                Z     = 1,
                Red   = 255,
                Green = 0,
                Blue  = 0,
            };

            SpriteManager.AddToLayer(minRangeSprite, temporaryLayer);

            // Rendering requires a camera. We'll create a temporary one (don't add it to the SpriteManager)
            var temporaryCamera = new Camera(null, newTextureWidth, newTextureHeight)
            {
                DrawsWorld = false, Z = 40
            };

            // We only want the camera to draw the layer
            temporaryCamera.UsePixelCoordinates();
            temporaryCamera.AddLayer(temporaryLayer);

            FlatRedBall.Graphics.Renderer.DrawCamera(temporaryCamera, null);

            //using (var fileStream = File.Create("range.png"))
            //{
            //    renderTarget.SaveAsPng(fileStream, newTextureWidth, newTextureHeight);
            //}

            SpriteManager.RemoveSprite(maxRangeSprite);
            SpriteManager.RemoveSprite(minRangeSprite);

            FlatRedBallServices.AddDisposable(
                "Max" + maxRange.ToString() + "Min" + minRange.ToString() + ".png",
                renderTarget,
                "ContentManagerName");

            return(renderTarget);
        }
Esempio n. 11
0
 public override void ReAddToManagers(FlatRedBall.Graphics.Layer layerToAddTo)
 {
     base.ReAddToManagers(layerToAddTo);
     FlatRedBall.Math.Geometry.ShapeManager.AddToLayer(mAxisAlignedRectangleInstance, LayerProvidedByContainer);
 }
Esempio n. 12
0
 public IEnumerable <RenderingLibrary.Graphics.Layer> GumLayersOnFrbLayer(FlatRedBall.Graphics.Layer frbLayer)
 {
     // Right now this returns all, but I'm making a static and instance version in case we want to have
     // support for async loading and adding (2 screens alive at once)
     return(AllGumLayersOnFrbLayer(frbLayer));
 }
Esempio n. 13
0
 public static IEnumerable <RenderingLibrary.Graphics.Layer> AllGumLayersOnFrbLayer(FlatRedBall.Graphics.Layer frbLayer)
 {
     if (frbLayer == null)
     {
         yield return(SystemManagers.Default.Renderer.MainLayer);
     }
     else if (mFrbToGumLayers.ContainsKey(frbLayer))
     {
         foreach (var item in mFrbToGumLayers[frbLayer])
         {
             yield return(item);
         }
     }
     else
     {
         yield break;
     }
 }
 public override void AddToManagers(FlatRedBall.Graphics.Layer layerToAddTo)
 {
     LayerProvidedByContainer = layerToAddTo;
     base.AddToManagers(layerToAddTo);
     CustomInitialize();
 }
 public override void ReAddToManagers(FlatRedBall.Graphics.Layer layerToAddTo)
 {
     base.ReAddToManagers(layerToAddTo);
 }
        public override void Initialize(bool addToManagers)
        {
            // Generated Initialize
            LoadStaticContent(ContentManagerName);
            ToolsetUIEntityInstance = new WinterEngine.Game.Entities.ToolsetUIEntity(ContentManagerName, false);
            ToolsetUIEntityInstance.Name = "ToolsetUIEntityInstance";
            AreaEntityInstance = new WinterEngine.Game.Entities.AreaEditorEntity(ContentManagerName, false);
            AreaEntityInstance.Name = "AreaEntityInstance";
            TilesetEditorEntityInstance = new WinterEngine.Game.Entities.TilesetEditorEntity(ContentManagerName, false);
            TilesetEditorEntityInstance.Name = "TilesetEditorEntityInstance";
            LayerInstance = new FlatRedBall.Graphics.Layer();
            LayerInstance.Name = "LayerInstance";

            base.Initialize(addToManagers);
        }