Пример #1
0
        public override void CleanUp()
        {
            SpriteRenderer.Instance.ConcludedDrawingEvent -= OnDrawingConcluded;

            PortionRenderTarget.Dispose();
            PortionRenderTarget = null;

            ScreenCopy.Dispose();
            ScreenCopy = null;

            TattleWindow = null;
        }
        protected ActionSubMenu() : base(MenuTypes.Vertical)
        {
            BoxMenu = new TextBox(new Vector2(SpriteRenderer.Instance.WindowCenter.X, SpriteRenderer.Instance.WindowCenter.Y + 220f), new Vector2(320f, 80f), null);
            BoxMenu.SetText(string.Empty);

            Texture2D battleGFX = AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.BattleGFX}.png");

            Rectangle rect = new Rectangle(743, 59, 15, 12);

            SelectionCursor = new LoopAnimation(battleGFX,
                                                AnimationGlobals.InfiniteLoop, true,
                                                new Animation.Frame(rect, 200d),
                                                new Animation.Frame(rect, 200d, new Vector2(1, 0)));

            HeaderImage = new NineSlicedTexture2D(battleGFX, new Rectangle(457, 812, 32, 16), 7, 6, 7, 9);
            MenuBG      = new NineSlicedTexture2D(battleGFX, new Rectangle(485, 846, 16, 16), 8, 8, 8, 8);
        }
Пример #3
0
        public TargetSelectionMenu(BattleUIManager bUIManager) : base(MenuTypes.Horizontal)
        {
            BUIManager = bUIManager;
            Texture2D cursorSheet = AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.UIRoot}/Cursor.png");

            Cursor = new ReverseAnimation(cursorSheet, AnimationGlobals.InfiniteLoop, true,
                                          new Animation.Frame(new Rectangle(4, 5, 14, 20), 110d),
                                          new Animation.Frame(new Rectangle(26, 5, 16, 20), 110d),
                                          new Animation.Frame(new Rectangle(49, 5, 20, 20), 110d),
                                          new Animation.Frame(new Rectangle(75, 5, 22, 16), 110d),
                                          new Animation.Frame(new Rectangle(105, 5, 21, 16), 110d));
            NameImage = new NineSlicedTexture2D(AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.BattleGFX}.png"),
                                                new Rectangle(457, 812, 32, 16), 7, 6, 7, 9);

            //Both games wrap the cursor
            WrapCursor = true;
        }
Пример #4
0
        public TattleRenderObj(Vector2 tattledPos)
        {
            TattledEntityPos = tattledPos;

            Vector2 windowSize = SpriteRenderer.Instance.WindowSize;

            int regionWidthOver2  = (int)RenderRegionSize.X / 2;
            int regionHeightOver2 = (int)RenderRegionSize.Y / 2;

            //Set the region of the screen to draw from
            ScreenRegion = new Rectangle((int)TattledEntityPos.X - regionWidthOver2, (int)TattledEntityPos.Y - regionHeightOver2, (int)RenderRegionSize.X, (int)RenderRegionSize.Y);

            /*Commented; we want to ensure that we get the full size of the part of the screen we need
             * It's easier to make sure that no BattleEntities are outside of this region than to adjust it, which has its own set of problems*/

            //if (ScreenRegion.X > windowSize.X) ScreenRegion.X -= (ScreenRegion.X - (int)windowSize.X) - ScreenRegion.Width;
            //if (ScreenRegion.X < 0) ScreenRegion.X = 0;
            //
            //if (ScreenRegion.Y > windowSize.Y) ScreenRegion.Y -= (ScreenRegion.Y - (int)windowSize.Y) - ScreenRegion.Height;
            //if (ScreenRegion.Y < 0) ScreenRegion.Y = 0;
            //
            //if (ScreenRegion.Right > windowSize.X) ScreenRegion.Width = ScreenRegion.Right - (int)windowSize.X;
            //if (ScreenRegion.Bottom > windowSize.Y) ScreenRegion.Height = (int)windowSize.Y - ScreenRegion.Y;

            StartPos = new Vector2(EndPos.X, -ScreenRegion.Height - Math.Abs(RenderRegionSize.Y - TattleBoxSize.Y));
            Position = StartPos;

            //Start out closed
            CurTargetRegion = new Rectangle(0, ScreenRegion.Height / 2, ScreenRegion.Width, 0);

            //Set up the RenderTargets
            PortionRenderTarget = new RenderTarget2D(SpriteRenderer.Instance.graphicsDeviceManager.GraphicsDevice, ScreenRegion.Width, ScreenRegion.Height);
            ScreenCopy          = new RenderTarget2D(SpriteRenderer.Instance.graphicsDeviceManager.GraphicsDevice, RenderingGlobals.BaseResolutionWidth, RenderingGlobals.BaseResolutionHeight);

            TattleWindow = new NineSlicedTexture2D(AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.BattleGFX}.png"),
                                                   new Rectangle(457, 812, 32, 16), 7, 6, 7, 9);

            SpriteRenderer.Instance.ConcludedDrawingEvent -= OnDrawingConcluded;
            SpriteRenderer.Instance.ConcludedDrawingEvent += OnDrawingConcluded;
        }