当前位置: 首页>>代码示例>>C#>>正文


C# Microsoft.Draw方法代码示例

本文整理汇总了C#中Microsoft.Draw方法的典型用法代码示例。如果您正苦于以下问题:C# Microsoft.Draw方法的具体用法?C# Microsoft.Draw怎么用?C# Microsoft.Draw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft的用法示例。


在下文中一共展示了Microsoft.Draw方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Draw

        public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
        {
            base.Draw(spriteBatch);

            // Draw Cast Animation
            if (!SkillActive && SkillSlots.Instance.active && ani_count <= 11)
                if (cast_animation != null)
                    spriteBatch.Draw(cast_animation, new Vector2(position.X - 60, position.Y - 85), Color.White * 0.75f);

            // Draw Skill Animation
            if (SkillActive && SkillSlots.Instance.active)
                if (skill_animation != null)
                {
                    if (this.spriteEffect == SpriteEffects.None)
                        spriteBatch.Draw(skill_animation,
                            new Vector2(position.X - ((skill_animation.Width - SpriteFrame.Width) * 0.5f) + animationOffset.X,
                                    position.Y - ((skill_animation.Height * 0.9f) - SpriteFrame.Height) + animationOffset.Y),
                            Color.White * 0.75f);
                    else
                        spriteBatch.Draw(skill_animation,
                            new Rectangle((int)(position.X - ((skill_animation.Width - SpriteFrame.Width) * 0.5f) + animationOffset.X),
                                          (int)(position.Y - ((skill_animation.Height * 0.9f) - SpriteFrame.Height) + animationOffset.Y),
                                          skill_animation.Width, skill_animation.Height),
                            new Rectangle(0, 0, skill_animation.Width,skill_animation.Height),
                            Color.White * 0.75f, 0, Vector2.Zero, SpriteEffects.FlipHorizontally, 0);
                }
        }
开发者ID:HaKDMoDz,项目名称:XNA_ScreenManager,代码行数:27,代码来源:Warrior.cs

示例2: draw

        public override void draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice)
        {
            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, publicStatics.spriteScale);
            //Background
            spriteBatch.Draw(Image.pauseMenu, new Rectangle(0, 0, publicStatics.screenSize.Width, publicStatics.screenSize.Height), Color.White);

            //Draw all labels
            for(int i = 0; i < labels.Count; i++)
            {
                labels[i].Draw(spriteBatch);
            }

            //Draw Bullet Points
            if (buttons[0].mouseHover())
                spriteBatch.Draw(imageRBC, new Rectangle(publicStatics.screenSize.Center.X - (int)(Font.cooper48.MeasureString("Resume").X / 2) - 52, publicStatics.screenSize.Center.Y - 36, 48, 48), Color.White);
            if (buttons[1].mouseHover())
                spriteBatch.Draw(imageRBC, new Rectangle(publicStatics.screenSize.Center.X - (int)(Font.cooper48.MeasureString("Main Menu").X / 2) - 52, publicStatics.screenSize.Center.Y - 26 + 90, 48, 48), Color.White);

            //Draw all Buttons
            for (int i = 0; i < buttons.Count; i++)
            {
                buttons[i].Draw(spriteBatch);
            }

            //Draw all Checkboxes
            for (int i = 0; i < checkboxes.Count; i++)
            {
                checkboxes[i].Draw(spriteBatch);
            }

            //Draw Mouse Cursor
            cursor.drawTexture(spriteBatch, graphicsDevice);
            spriteBatch.End();
        }
开发者ID:BenHamrick,项目名称:Heart-Attack-2013-Game-Jam,代码行数:34,代码来源:PauseMenu.cs

示例3: Draw

        public void Draw(Microsoft.Xna.Framework.Content.ContentManager content, Microsoft.Xna.Framework.Graphics.SpriteBatch batch)
        {
            if (font == null)
            {
                //Load the font
                font = content.Load<SpriteFont>(@"Fonts/LightText");
            }

            batch.Draw(content, SpriteManager.GetSprite(ColourSpriteName.WHITE), borderRect, Color.DarkGray);
            batch.Draw(content, SpriteManager.GetSprite(InterfaceSpriteName.PAPER_TEXTURE), rect, Color.White);

            batch.Draw(content, SpriteManager.GetSprite(InterfaceSpriteName.WOOD_TEXTURE), objectNameRect, Color.WhiteSmoke);
            batch.DrawString(font, treasureChest.Name, objectNameRect, Alignment.Center, Color.Black);

            batch.Draw(content, SpriteManager.GetSprite(InterfaceSpriteName.CLOSE), crossRect, Color.White);

            for (int i = 0; i < itemRectangles.Count; i++)
            {
                Rectangle r = itemRectangles[i];

                MapItem mi = null;

                if (treasureChest.Contents.Count > i)
                {
                    mi = treasureChest.Contents[i];
                    batch.Draw(content, mi.Graphics[0], r, Color.White);
                }

            }

            batch.DrawString(font, descriptionShown, descriptionRect, Alignment.Left, Color.Black);
            batch.Draw(content, SpriteManager.GetSprite(InterfaceSpriteName.WOOD_TEXTURE), takeAllRect, Color.White);
            batch.DrawString(font, "TAKE ALL", takeAllRect, Alignment.Center, Color.Black);
        }
开发者ID:Haedrian,项目名称:Divine-Right,代码行数:34,代码来源:LootComponent.cs

示例4: InternalDraw

 protected override void InternalDraw(Microsoft.Xna.Framework.GameTime gameTime, Microsoft.Xna.Framework.Graphics.SpriteBatch batch)
 {
     if (((EnemyTypeII)m_unit).CombineList.Count != 0)
     {
         foreach (var ptr in ((EnemyTypeII)m_unit).CombineList)
         {
             ((EnemyIIComponent)ptr.Sprite).Draw(gameTime, batch);
             //batch.Draw(ptr.Body, ptr.Locate, null, ptr.Color, 0, new Vector2(40), ptr.EnemySize * m_worldManager.Scale, SpriteEffects.None, 0);
         }
         batch.Draw(m_unit.ListRing[m_unit.CurrentRing].Target, base.Locate + new Vector2(20,0),
                    m_unit.ListRing[m_unit.CurrentRing].Frame, m_unit.ListRing[m_unit.CurrentRing].Color,
                    base.Rotation,
                    new Vector2((float) m_unit.ListRing[m_unit.CurrentRing].Frame.Height/2),
                    m_unit.RingSize/1000*m_worldManager.Scale, SpriteEffects.None, 0);
     }
     if(((EnemyTypeII)m_unit).CombineList.Count != 0 || ((EnemyTypeII)m_unit).BeCatch)
     {
         batch.Draw(((EnemyTypeII)m_unit).Body, base.Locate, null, ((EnemyTypeII)m_unit).Color, ((EnemyTypeII)m_unit).Rotation, new Vector2(40), m_worldManager.Scale * ((EnemyTypeII)m_unit).EnemySize, SpriteEffects.None, 0);
     }
     else
     {
         if (((EnemyTypeII)m_unit).Status == AIBase.Status.Attck)
         {
             foreach (var ptr in ((EnemyTypeII)m_unit).Sharp)
             {
                 batch.Draw(ptr.Target, base.Locate, ptr.Frame, Color.AliceBlue, 0, new Vector2(40), ((EnemyTypeII)m_unit).EnemySize * m_worldManager.Scale, SpriteEffects.None, 0);
             }
         }
         batch.Draw(((EnemyTypeII)m_unit).Body, base.Locate, null, ((EnemyTypeII)m_unit).Color, ((EnemyTypeII)m_unit).Rotation, new Vector2(40), m_worldManager.Scale * ((EnemyTypeII)m_unit).EnemySize, SpriteEffects.None, 0);
         batch.Draw(m_unit.ListRing[m_unit.CurrentRing].Target, base.Locate, m_unit.ListRing[m_unit.CurrentRing].Frame, m_unit.ListRing[m_unit.CurrentRing].Color, base.Rotation,
             new Vector2((float)m_unit.ListRing[m_unit.CurrentRing].Frame.Height / 2), m_unit.RingSize / 1000 * m_worldManager.Scale, SpriteEffects.None, 0);
     }
 }
开发者ID:fanthos,项目名称:Game-Heal,代码行数:33,代码来源:EnemyIiComponent.cs

示例5: Draw

        public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
        {
            if (RenderBalloons) {
                spriteBatch.Draw(Assets.MenuBalloons, new Rectangle(X - 55, Y - 190, 150, 195), Color.White);
                spriteBatch.Draw(Assets.MenuBalloons, new Rectangle(X + 123, Y - 190, 150, 195), Color.White);
            }

            if (RenderRopes) {
                spriteBatch.Draw(Assets.MenuRope, new Rectangle(X + 10, Y + 95, 3, 115), Color.White);
                spriteBatch.Draw(Assets.MenuRope, new Rectangle(X + 188, Y + 95, 3, 115), Color.White);
            }

            if (selected) {
                spriteBatch.Draw(Assets.MenuSignGlow, new Rectangle(X - 30, Y - 30, Size.X + 60, Size.Y + 60), Color.White);
            }

            spriteBatch.Draw(Graphic, new Rectangle(X, Y, Size.X, Size.Y), Color.White);

            if (hoverTime > 0 && hoverTime <= maxHoverTime) {
                PlayerHand hand = (PlayerHand)GetFirstCollidingEntity("hand");
                if (hand == null)
                    return;

                for (int i = 0; i <= 360; i++) {
                    var destRect = new Rectangle(hand.X - 50, hand.Y - 50, 1, 20);

                    var asset = Assets.CirclePartFilled;
                    if ((360 / maxHoverTime) * hoverTime <= i) {
                        asset = Assets.CirclePartEmpty;
                    }

                    spriteBatch.Draw(asset, destRect, null, Color.White, MathHelper.ToRadians(i), new Vector2(0, 20), SpriteEffects.None, 0);
                }
            }
        }
开发者ID:dotKokott,项目名称:MathFighter,代码行数:35,代码来源:MenuItem.cs

示例6: draw

		public override void draw (Microsoft.Xna.Framework.Graphics.SpriteBatch par1)
		{
			par1.Draw (sprite, shape, new Rectangle (shape.Width * ((int)frame), 0, shape.Width, shape.Height), Color.White);
			if (isHeart) 
				par1.Draw (Core.Png [7], new Vector2 (shape.X, shape.Y), Color.White);

		}
开发者ID:chaipokoi,项目名称:Ocalm,代码行数:7,代码来源:Target.cs

示例7: Draw

 public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch sb)
 {
     sb.Draw(texture, area, color);
     if (state)
         sb.Draw(checkTexture, area, color);
     sb.DrawString(Fonts.Arial, name, labelPos, color);
 }
开发者ID:idaohang,项目名称:Helicopter-Autopilot-Simulator,代码行数:7,代码来源:Checkbox.cs

示例8: Draw

 public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch sb)
 {
     sb.Draw(border, borderRect, Color.White);
     sb.Draw(back, boundRect, Color.White);
     sb.Draw(front, fillRect, Color.White);
     sb.Draw(back, sliderRect, Color.Red);
 }
开发者ID:Pustinek-G,项目名称:Personal,代码行数:7,代码来源:Slider.cs

示例9: DrawInContainer

        public override void DrawInContainer(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, SignsOfLife.UI.Containers.Container container, Color tintColor, Color behindTint)
        {
            Vector2 position = new Vector2((float)this._localPosX * Container.CONTAINER_SCALE_VECTOR.X + container.X, (float)this._localPosY * Container.CONTAINER_SCALE_VECTOR.Y + container.Y);
            Rectangle noChargedOverlay = new Rectangle((int)position.X,(int)position.Y,_rectSourceNoPower.Width,_rectSourceNoPower.Height);
            Rectangle chargedOverlay = noChargedOverlay;
            Rectangle chargedSource = _rectSourcePowered;
            int diff = (int)((float)chargedOverlay.Height*(Charge/MaxCharge));
            chargedOverlay.Y += chargedOverlay.Height-diff;
            chargedOverlay.Height = diff;
            chargedSource.Y += chargedSource.Height-diff;
            chargedSource.Height = diff;
            //

            SpriteEffects effects = SpriteEffects.None;
            if (base.IsFlipped)
            {
                effects = SpriteEffects.FlipHorizontally;
            }
            if (this._amount == 1)
            {
                spriteBatch.Draw(this._texture, noChargedOverlay, new Rectangle?(_rectSourceNoPower), tintColor, 0f, Vector2.Zero, effects, 0f);
                spriteBatch.Draw(this._texture, chargedOverlay, new Rectangle?(chargedSource), tintColor, 0f, Vector2.Zero, effects, 0f);
                return;
            }
            spriteBatch.Draw(this._texture, position+new Vector2(this.MULTIPLE_QUANTITY_SHIFT,0), new Rectangle?(this._spriteBounds), behindTint, 0f, Vector2.Zero, Container.CONTAINER_SCALE_VECTOR, effects, 0f);
            spriteBatch.Draw(this._texture, position, new Rectangle?(this._spriteBounds), tintColor, 0f, Vector2.Zero, Container.CONTAINER_SCALE_VECTOR, effects, 0f);
        }
开发者ID:Itaros,项目名称:SOLPI-Autostyle,代码行数:27,代码来源:ChargableBattery.cs

示例10: Draw

        public override void Draw(Microsoft.Xna.Framework.GameTime gameTime, Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
        {
            base.Draw(gameTime, spriteBatch);

            spriteBatch.DrawString(scoreFont, score.ToString(), scorePos, Color.White);
            spriteBatch.Draw(homeTex, new Vector2(70.0f, 650.0f), Color.White);
            spriteBatch.Draw(replayTex, new Vector2(820.0f, 650.0f), Color.White);
        }
开发者ID:davecheesefish,项目名称:DiscoBounce,代码行数:8,代码来源:EndGameScreen.cs

示例11: Draw

        public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
        {
            if (selected) {
                spriteBatch.Draw(Assets.MenuButtonGlow, new Rectangle((int)X - 30, (int)Y - 30, Size.X + 60, Size.Y + 60), Color.White);
            }

            spriteBatch.Draw(Graphic, new Rectangle((int)X, (int)Y, Size.X, Size.Y), Color.White);
        }
开发者ID:ravensinth,项目名称:CSTouch,代码行数:8,代码来源:MenuButton.cs

示例12: Draw

 public override void Draw(Microsoft.Xna.Framework.GameTime gameTime, Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
 {
     if(duringTransition || duringFade)
     {
         spriteBatch.Draw(backgroundTexture, transitionPosition, null, transitionTextureColor, 0, Vector2.Zero, 1f, SpriteEffects.None, LayerIdentifiers.TRANSITION_IMAGE);
     }
     spriteBatch.Draw(backgroundTexture, basePosition, null, Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, LayerIdentifiers.BACKGROUND_IMAGE);
 }
开发者ID:HeavyBomber,项目名称:HeavyBomber,代码行数:8,代码来源:BackgroundTransition.cs

示例13: Draw

 public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch batch)
 {
     if (!disabled[(int)Buttons.start]) batch.Draw(ResourceManager.startButton, startRectangle, selected == (int)Buttons.start ? Color.Yellow : Color.White);
     if (!disabled[(int)Buttons.options]) batch.Draw(ResourceManager.optionsButton, optionsRectangle, selected == (int)Buttons.options ? Color.Yellow : Color.White);
     if (!disabled[(int)Buttons.controls]) batch.Draw(ResourceManager.controlButton, controlRectangle, selected == (int)Buttons.controls ? Color.Yellow : Color.White);
     if (!disabled[(int)Buttons.highscores]) batch.Draw(ResourceManager.highscoresButton, highscoresRectangle, selected == (int)Buttons.highscores ? Color.Yellow : Color.White);
     if (!disabled[(int)Buttons.exit]) batch.Draw(ResourceManager.exitButton, exitRectangle, selected == (int)Buttons.exit ? Color.Yellow : Color.White);
 }
开发者ID:Numprt,项目名称:Alien_Banjos,代码行数:8,代码来源:MainMenuState.cs

示例14: Draw

 public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite)
 {
     //base.Draw(sprite);
     sprite.Begin();
     sprite.Draw(texture, drawVector, Color.White);
     sprite.Draw(texture, drawVector + new Vector2(width/2, height/2), null, Color.White, -degree, new Vector2(width/2, height/2), new Vector2(1, 1), SpriteEffects.None, 0);
     //sprite.Draw(texture, drawVector + new Vector2(-48,-48), null, Color.White, -degree, new Vector2(48,48), new Vector2(1, 1), SpriteEffects.None, 0);
     sprite.End();
 }
开发者ID:pentiumx,项目名称:Tasrush-2DActionGame,代码行数:9,代码来源:RollingStone.cs

示例15: Draw

 public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Microsoft.Xna.Framework.GameTime gameTime)
 {
     if (nbVies == 3)
         base.Draw(spriteBatch, gameTime);
     if (nbVies == 2)
         spriteBatch.Draw(heart2, Position, Color.White);
     if (nbVies == 1)
         spriteBatch.Draw(heart1, Position, Color.White);
 }
开发者ID:faudeval,项目名称:projet,代码行数:9,代码来源:Life.cs


注:本文中的Microsoft.Draw方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。