コード例 #1
0
        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);
            }
        }
コード例 #2
0
 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);
     }
 }
コード例 #3
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();
        }