示例#1
0
 public override void Generate(SpriteBatch sb)
 {
     base.Generate(sb);
     sb.Draw(menuTextureSheet, frameBox, panelItemFrameSource, Color.White);
     //   sb.Draw(Game1.hitboxHelp, textBox, Color.White);
     TextUtility.DrawComplex(sb, bi.itemDescription, BattleGUI.testSF32, textBox, TextUtility.OutLining.Center, Color.White, 0f, false);
 }
 public override void Draw(SpriteBatch sb)
 {
     base.Draw(sb);
     buttonPanel.Draw(sb, Color.White);
     if (!ButtonText.Equals(""))
     {
         TextUtility.Draw(sb, ButtonText, font, buttonPanel.Position(), TextUtility.OutLining.Center, Color.Gold, 1f, false, default(Matrix), Color.Silver, false);
     }
 }
 public override void Draw(SpriteBatch sb)
 {
     sb.End();
     sb.GraphicsDevice.SetRenderTarget(UIElementRender);
     sb.GraphicsDevice.Clear(Color.TransparentBlack);
     sb.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp);
     TextUtility.Draw(sb, input.ToString(), sf, new Rectangle(Point.Zero, size), TextUtility.OutLining.Center, textC, 1.0f, false);
     sb.End();
     sb.GraphicsDevice.SetRenderTarget(null);
 }
示例#4
0
        public override KeyValuePair <RenderTarget2D, Rectangle> DrawReturnRender(SpriteBatch sb)
        {
            sb.End();
            sb.GraphicsDevice.SetRenderTarget(scrollRender);
            sb.GraphicsDevice.Clear(Color.TransparentBlack);
            sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, scrollMatrix);

            float opacity = 0.6f;

            for (int i = 0; i < items.Length; i++)
            {
                if (i != selectIndex)
                {
                    itemPanels[i].Draw(sb, Color.LightYellow * opacity);
                }
                else
                {
                    itemPanels[i].Draw(sb, Color.LightYellow);
                }
            }

            for (int i = 0; i < items.Length; i++)
            {
                if (i != selectIndex)
                {
                    TextUtility.Draw(sb, items[i], font, itemPositions[i], TextUtility.OutLining.Center, Color.Silver * opacity, 1f, false, scrollMatrix, Color.Gray * opacity, false);
                }
                else
                {
                    TextUtility.Draw(sb, items[i], font, itemPositions[i], TextUtility.OutLining.Center, Color.Silver, 1f, false, scrollMatrix, Color.Gray, false);
                }
            }


            sb.End();
            sb.GraphicsDevice.SetRenderTarget(completeRender);
            sb.GraphicsDevice.Clear(Color.TransparentBlack);
            sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, null);

            bg.Draw(sb, Color.Gray);

            sb.Draw(scrollRender, renderDrawPos, Color.White);

            if (bNeedsScrollbarActive)
            {
                wheel.Draw(sb);
            }
            else
            {
                wheel.DrawNotActive(sb);
            }
            sb.End();

            return(new KeyValuePair <RenderTarget2D, Rectangle>(completeRender, completeRenderPos));
        }
示例#5
0
 public void Draw(SpriteBatch sb, Matrix m, float opacity)
 {
     sb.Draw(menuTextureSheet, frameLocation, panelItemFrameSource, Color.White * opacity);
     sb.Draw(menuTextureSheet, new Rectangle(displayFrameLocation.X - 1, displayFrameLocation.Y - 1, displayFrameLocation.Width + 2, displayFrameLocation.Height + 2), panelItemFrameSource, Color.White * opacity);
     bi.itemTexAndAnimation.Draw(sb, displayFrameLocation, opacity);
     // sb.Draw(itemPanel., displayFrameLocation, Color.Red);
     // sb.Draw(Game1.hitboxHelp, displayNameLocation, Color.Green);
     TextUtility.Draw(sb, "x" + bi.itemAmount.ToString(), BattleGUI.testSF25, displayAmountTypeLocation, TextUtility.OutLining.Left, bi.itemRarityColour() * opacity, 0f, false, m, default(Color), false);
     TextUtility.Draw(sb, bi.itemName, BattleGUI.testSF25, displayNameLocation, TextUtility.OutLining.Left, bi.itemRarityColour() * opacity, 0f, false, m, default(Color), false);
     TextUtility.Draw(sb, bi.itemType.ToString(), BattleGUI.testSF25, displayNameTypeLocation, TextUtility.OutLining.Left, Color.Silver * opacity, 0f, false, m, default(Color), false);
 }
示例#6
0
        internal void Draw(SpriteBatch sb)
        {
            sb.End();
            sb.GraphicsDevice.SetRenderTarget(render);
            sb.GraphicsDevice.Clear(Color.TransparentBlack);
            sb.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp);

            float opacityMod = 0.8f;

            if (bCursorFocusRight)
            {
                bgPanelLeft.Draw(sb, Color.White);
                if (bBuildUp)
                {
                    bgPanelRight.Draw(sb, Color.White * ((selectionTimer.percentageDone() + opacityMod) * opacityMod));
                }
                else
                {
                    bgPanelRight.Draw(sb, Color.White * ((1.0f + opacityMod - selectionTimer.percentageDone()) * opacityMod));
                }
            }
            else
            {
                bgPanelRight.Draw(sb, Color.White);
                if (bBuildUp)
                {
                    bgPanelLeft.Draw(sb, Color.White * ((selectionTimer.percentageDone() + opacityMod) * opacityMod));
                }
                else
                {
                    bgPanelLeft.Draw(sb, Color.White * ((1.0f + opacityMod - selectionTimer.percentageDone()) * opacityMod));
                }
            }


            TextUtility.Draw(sb, rightPanelTitle.getText() + " (" + bc.CCC.abiEquipList.abilities.Count + @"/" + bc.CCC.abiEquipList.amount + ")", TitleFont, rightPanelTitlePosition, TextUtility.OutLining.Left, Color.White, 1f, true, default(Matrix), Color.Silver, false);
            // sb.Draw(Game1.WhiteTex, rightPanelAbilityLineup, Color.Red);

            sb.Draw(AbilitySelectTab.GetRenderRight(), new Rectangle(0, 0, 1366, 768), Color.White);


            TextUtility.Draw(sb, leftPanelTitle.getText(), TitleFont, leftPanelTitlePosition, TextUtility.OutLining.Left, Color.White, 1f, true, default(Matrix), Color.Silver, false);

            sb.Draw(AbilitySelectTab.GetRenderLeft(), new Rectangle(0, 0, 1366, 768), Color.White);

            if (selectedAbility != null && selectedAbility.asd != null)
            {
                selectedAbility.asd.Draw(sb);
            }

            sb.End();
            sb.GraphicsDevice.SetRenderTarget(null);
        }
示例#7
0
        internal void Draw(SpriteBatch sb)
        {
            sb.End();
            sb.GraphicsDevice.SetRenderTarget(render);
            sb.GraphicsDevice.Clear(Color.TransparentBlack);
            sb.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp);

            parent.abilityIcon.Draw(sb, iconBox);
            TextUtility.Draw(sb, parent.GetName(), abilityNameFont, abilityTitleBox, TextUtility.OutLining.Left, Color.Gold, 1f, true, default(Matrix), Color.Silver, false);
            TextUtility.Draw(sb, parent.GetCosts(), abilityNameFont, abilityCostBox, TextUtility.OutLining.Left, Color.Gold, 1f, true, default(Matrix), Color.Silver, false);

            sb.End();
        }
示例#8
0
        private void DrawLoadScreen(SpriteBatch sb, RenderTarget2D target = null)
        {
            float opactiy = (float)(postLoadTimer - timePassedLoadTimer) / postLoadTimer;

            sb.Draw(Game1.WhiteTex, new Rectangle(0, 0, 1366, 768), Color.Black * opactiy);
            TextUtility.Draw(sb, "Loading...", sf, new Rectangle(1000, 600, 300, 80), TextUtility.OutLining.Left, Color.Gold * opactiy, 1f, true, default(Matrix), Color.Silver * opactiy, false);
            bReadyToLoad = true;
            if (bFinishedLoading)
            {
                TextUtility.Draw(sb, "Done", sf, new Rectangle(1000, 680, 300, 40), TextUtility.OutLining.Left, Color.Snow * opactiy, 1f, true, default(Matrix), Color.Silver * opactiy, false);
                sb.Draw(target, new Rectangle(0, 0, 1366, 768), Color.White * (1.0f - opactiy));
            }
        }
        public void Draw(SpriteBatch sb, Matrix m)
        {
            sb.End();
            sb.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp, null, null, null, m);

            textBGPanel.Draw(sb, Color.White);

            if (bIsSelected)
            {
                Rectangle selected = new Rectangle();
                int       os       = 4;
                if (selectIndex == 0)
                {
                    selected = new Rectangle(prompt1Panel.Position().X - os, prompt1Panel.Position().Y - os, prompt1Panel.Position().Width + os * 2, prompt1Panel.Position().Height + os * 2);
                }
                else if (selectIndex == 1)
                {
                    selected = new Rectangle(prompt2Panel.Position().X - os, prompt2Panel.Position().Y - os, prompt2Panel.Position().Width + os * 2, prompt2Panel.Position().Height + os * 2);
                }
                else if (selectIndex == 2)
                {
                    selected = new Rectangle(prompt3Panel.Position().X - os, prompt3Panel.Position().Y - os, prompt3Panel.Position().Width + os * 2, prompt3Panel.Position().Height + os * 2);
                }

                sb.Draw(Game1.WhiteTex, selected, Color.Orange * .75f);
            }

            prompt1Panel.Draw(sb, Color.White);
            prompt2Panel.Draw(sb, Color.White);
            prompt3Panel.Draw(sb, Color.White);

            TextUtility.Draw(sb, keyAction.actionIndentifierString, font, textBGPanel.Position(), TextUtility.OutLining.Center, Color.Gold, 1f, false, m, Color.Silver, false);

            if (keyAction.whatKeysIsActionAssignedTo[0].assignedActionKey != default(Microsoft.Xna.Framework.Input.Keys))
            {
                String keyName = keyAction.whatKeysIsActionAssignedTo[0].assignedActionKey.ToString();
                TextUtility.Draw(sb, keyName, font, prompt1Panel.Position(), TextUtility.OutLining.Center, Color.Gold, 1f, false, m, Color.Silver, false);
            }

            if (keyAction.whatKeysIsActionAssignedTo[1].assignedActionKey != default(Microsoft.Xna.Framework.Input.Keys))
            {
                String keyName = keyAction.whatKeysIsActionAssignedTo[1].assignedActionKey.ToString();
                TextUtility.Draw(sb, keyName, font, prompt2Panel.Position(), TextUtility.OutLining.Center, Color.Gold, 1f, false, m, Color.Silver, false);
            }

            if (keyAction.whatKeysIsActionAssignedTo[2].assignedGamePadButton != default(Microsoft.Xna.Framework.Input.Buttons))
            {
                String keyName = keyAction.whatKeysIsActionAssignedTo[2].assignedGamePadButton.ToString();
                TextUtility.Draw(sb, keyName, font, prompt3Panel.Position(), TextUtility.OutLining.Center, Color.Gold, 1f, false, m, Color.Silver, false);
            }
        }
示例#10
0
        public override void Generate(SpriteBatch sb)
        {
            //if (ds != null)
            //{
            //    ds.Generate(sb);
            //}

            sb.End();
            sb.GraphicsDevice.SetRenderTarget(itemPanelRender);
            sb.GraphicsDevice.Clear(Color.TransparentBlack);
            sb.Begin(SpriteSortMode.Immediate, null, SamplerState.PointClamp, null, null, null, itemPanelScrollMatrix);

            var temp = new Rectangle(new Point(0, (int)verticalModifier - 5), itemPanelRender.Bounds.Size);

            if (!lip.Contains(selectedItemPanel))
            {
                foreach (var item in lip.FindAll(b => b.Contains(temp)))
                {
                    item.Draw(sb, itemPanelScrollMatrix);
                }
            }
            else
            {
                foreach (var item in lip.FindAll(b => b.Contains(temp) && !b.Equals(selectedItemPanel)))
                {
                    item.Draw(sb, itemPanelScrollMatrix, .35f);
                }

                selectedItemPanel.Draw(sb, itemPanelScrollMatrix);
            }



            sb.End();
            sb.GraphicsDevice.SetRenderTarget(getRenderSource());
            sb.GraphicsDevice.Clear(Color.TransparentBlack);
            sb.Begin(SpriteSortMode.Immediate, null, SamplerState.PointClamp);

            sb.Draw(menuTextureSheet, location, panelFrameSource, Color.White);
            // sb.Draw(Game1.hitboxHelp, TitleTextBox, Color.White);
            TextUtility.Draw(sb, title, BattleGUI.testSF32, TitleTextBox, TextUtility.OutLining.Center, Color.White, 0f, false);

            // sb.Draw(Game1.hitboxHelp, itemCollectionRenderLocation, Color.White);
            sb.Draw(itemPanelRender, itemCollectionRenderLocation, itemPanelRender.Bounds, Color.White);

            sb.End();
            sb.GraphicsDevice.SetRenderTarget(null);
        }
示例#11
0
        internal void GenerateRender(SpriteBatch sb)
        {
            sb.End();
            sb.GraphicsDevice.SetRenderTarget(render);
            sb.GraphicsDevice.Clear(Color.TransparentBlack);
            sb.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp);

            panel.Draw(sb, Color.White);
            TextUtility.Draw(sb, expectedDMGText.getText() + potencyText, font, titleBox, TextUtility.OutLining.Left, Color.White, 1f, true, default(Matrix), Color.Silver, false);
            if (!parent.abilityDescription.Equals("", StringComparison.OrdinalIgnoreCase))
            {
                TextUtility.DrawComplex(sb, parent.abilityDescription, font, descriptionBox, TextUtility.OutLining.Center, Color.LightGray, 1f, true, default(Matrix), Color.Silver);
            }


            sb.End();
        }
 internal void Draw(SpriteBatch sb)
 {
     if (drawFunction != null)
     {
         drawFunction(sb, this);
     }
     else
     {
         try
         {
             TextUtility.Draw(sb, text, font, textBox, TextUtility.OutLining.Left, textColor, 1f, true, GameProcessor.CameraScaleMatrix, bgTextColor, false);
             sb.End();
         }
         catch (Exception e)
         {
         }
     }
 }
示例#13
0
        public void GenerateRenderEditor(SpriteBatch sb)
        {
            sb.End();
            sb.GraphicsDevice.SetRenderTarget(gridRender);
            sb.GraphicsDevice.Clear(Color.Black);
            sb.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp, null, null, null, m);

            foreach (var item in nodes)
            {
                item.DrawGrid(sb);
            }

            foreach (var item in nodes)
            {
                item.DrawNode(sb);
                TextUtility.DrawString(sb, Game1.defaultFont, item.ToString(), item.nodePos.ToVector2() * 64 + item.nodePos.ToVector2() * 32, new Vector2(1), Color.White, Color.Black);
            }



            sb.End();
            sb.GraphicsDevice.SetRenderTarget(null);
        }
示例#14
0
        public void Draw(SpriteBatch sb, Color c, float opacityText = 1f)
        {
            base.Draw(sb, c);
            if (text != null)
            {
                if (!bSelected && !bWasSelected)
                {
                    TextUtility.Draw(sb, text.getText() + TextAddition, sf, Position(), ol, tc * opacityText, 1f, bUpScaling, default(Matrix), lc * opacityText, false);
                }

                if (bSelected && !bWasSelected)
                {
                    float otherOpacity = (float)(stepsTaken / (float)steps);
                    if (otherOpacity != 0)
                    {
                        TextUtility.Draw(sb, text.getText() + TextAddition, sf, Position(), ol, sc * opacityText * (otherOpacity), 1f, bUpScaling, default(Matrix), lc * opacityText * (otherOpacity), false);
                    }
                    if (otherOpacity != 1.0f)
                    {
                        TextUtility.Draw(sb, text.getText() + TextAddition, sf, Position(), ol, tc * opacityText * (1.0f - otherOpacity), 1f, bUpScaling, default(Matrix), lc * opacityText * (1.0f - otherOpacity), false);
                    }
                }

                if (!bSelected && bWasSelected)
                {
                    float otherOpacity = (float)(stepsTaken / (float)steps);
                    if (otherOpacity != 0f)
                    {
                        TextUtility.Draw(sb, text.getText() + TextAddition, sf, Position(), ol, tc * opacityText * (otherOpacity), 1f, bUpScaling, default(Matrix), lc * opacityText * (otherOpacity), false);
                    }
                    if (otherOpacity != 1.0f)
                    {
                        TextUtility.Draw(sb, text.getText() + TextAddition, sf, Position(), ol, sc * opacityText * (1.0f - otherOpacity), 1f, bUpScaling, default(Matrix), lc * opacityText * (1.0f - otherOpacity), false);
                    }
                }
            }
        }
示例#15
0
        internal void GenerateRender(SpriteBatch sb)
        {
            sb.End();
            sb.GraphicsDevice.SetRenderTarget(render);
            sb.GraphicsDevice.Clear(Color.TransparentBlack);
            sb.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp);

            sb.Draw(Game1.WhiteTex, panel.Position(), Color.White);
            panel.Draw(sb, Color.White);

            for (int i = 0; i < portraitFrames.Length; i++)
            {
                portraitFrames[i].Draw(sb);
            }

            if (bIsFirst && !psd.databaseLoc.Equals(""))
            {
                // sb.Draw(Game1.WhiteTex,titleTextBox,Color.Yellow);
                TextUtility.Draw(sb, latestText.getText(), font, titleTextBox, TextUtility.OutLining.Center, Color.White, 1f, true, default(Matrix), Color.Silver, false);
            }
            TextUtility.Draw(sb, dateTimeString, font, dateTimeBox, TextUtility.OutLining.Center, Color.White, 1f, true, default(Matrix), Color.Silver, false);

            sb.End();
        }
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            //ResolutionUtility.toggleFullscreen();
            GraphicsDevice.Clear(Color.Red);
            GraphicsDevice.SetRenderTarget(gameRender);
            //   spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, SceneUtility.transform);
            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, null);
            if (!bRunEditMode && !StartScreen.bIsRunning || (StartScreen.bIsRunning && startScreen.bFinishedLoading))
            {
                scenes[SceneUtility.currentScene].Draw(gameTime, spriteBatch);

                TextUtility.Draw(spriteBatch, "Pre-alpha combat demo v0.1.6", defaultFont, new Rectangle(1000, 650, 300, 100), TextUtility.OutLining.Left, Color.Gold, 1f, false, default(Matrix), Color.Silver, false);
                //if ((int)Screens.Editor != SceneUtility.currentScene)
                //{
                //    CursorUtility.Draw(spriteBatch);
                //}
            }
            if (StartScreen.bIsRunning)
            {
                startScreen.Draw(spriteBatch, gameRender);
                spriteBatch.End();
                spriteBatch.GraphicsDevice.SetRenderTarget(gameRender);
                spriteBatch.GraphicsDevice.Clear(Color.TransparentBlack);
                spriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp, null, null, null);

                if (!OptionsMenu.bIsRunning)
                {
                    spriteBatch.Draw(startScreen.getRender(), gameRender.Bounds, Color.White);
                }
                else
                {
                    spriteBatch.Draw(OptionsMenu.getRender(), gameRender.Bounds, Color.White);
                }
                BattleGUI.DrawCursor(spriteBatch, KeyboardMouseUtility.uiMousePos.ToVector2(), 1f);

                TextUtility.Draw(spriteBatch, "Pre-alpha combat demo v0.1.6", defaultFont, new Rectangle(1000, 650, 300, 100), TextUtility.OutLining.Left, Color.Gold, 1f, false, default(Matrix), Color.Silver, false);

                spriteBatch.End();
            }

            spriteBatch.End();

            //if (bRunEditMode)
            //{
            //    ScripTestingScene.Draw(spriteBatch);
            //}
            //ResolutionUtility.toggleFullscreen();
            GraphicsDevice.SetRenderTarget(null);
            Matrix m = Matrix.CreateTranslation(0, 0, 1) * Matrix.CreateScale(ResolutionUtility.stdScale.X, ResolutionUtility.stdScale.Y, 1);

            m.M11 = 1.0f;
            m.M22 = 1.0f;
            if (graphics.IsFullScreen)
            {
                Rectangle targetDrawInFullScreen = new Rectangle(((int)monitorSize.X - (int)ResolutionUtility.WindowSizeBeforeFullScreen.X) / 2, ((int)monitorSize.Y - (int)ResolutionUtility.WindowSizeBeforeFullScreen.Y) / 2, (int)ResolutionUtility.WindowSizeBeforeFullScreen.X, (int)ResolutionUtility.WindowSizeBeforeFullScreen.Y);
                spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, null, null);
                // spriteBatch.Draw(gameRender, targetDrawInFullScreen, gameRender.Bounds, Color.White);
                spriteBatch.Draw(gameRender, new Rectangle(0, 0, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight), Color.White);
                spriteBatch.End();

                //spriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp, null, null, null, SceneUtility.transform);
                //spriteBatch.Draw(gameRender, new Rectangle(0,0,1366,768), Color.White);
                //spriteBatch.End();

                //spriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp, null, null, null, null);
                //spriteBatch.Draw(gameRender, gameRender.Bounds, Color.White);
                //spriteBatch.End();
            }
            else
            {
                spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, null, null);
                // spriteBatch.Draw(gameRender, gameRender.Bounds, Color.White);
                // Rectangle targetDrawInFullScreen = new Rectangle(((int)monitorSize.X - (int)ResolutionUtility.WindowSizeBeforeFullScreen.X) / 2, ((int)monitorSize.Y - (int)ResolutionUtility.WindowSizeBeforeFullScreen.Y) / 2, (int)ResolutionUtility.WindowSizeBeforeFullScreen.X, (int)ResolutionUtility.WindowSizeBeforeFullScreen.Y);
                spriteBatch.Draw(gameRender, new Rectangle(0, 0, (int)ResolutionUtility.WindowSizeBeforeFullScreen.X, (int)ResolutionUtility.WindowSizeBeforeFullScreen.Y), Color.White);
                spriteBatch.End();
            }
            spriteBatch.End();
            base.Draw(gameTime);
        }
示例#17
0
 public void Draw(SpriteBatch sb)
 {
     TextUtility.Draw(sb, gt.getText(), sf, position, TextUtility.OutLining.Center, tc, 1f, true, default(Matrix), Color.LightBlue, false);
 }