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


C# Camera2D.Draw方法代码示例

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


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

示例1: Draw

 public override void Draw(Camera2D camera)
 {
     if ((this.ShowTerrain && CollisionMath.Intersects(this.Bounds, camera.Bounds)) || base.ForceDraw)
     {
         camera.Draw(Game.GenericTexture, base.Position, new Rectangle?(new Rectangle(0, 0, this.Width, this.Height)), base.TextureColor, MathHelper.ToRadians(base.Rotation), Vector2.Zero, 1f, SpriteEffects.None, 0f);
     }
 }
开发者ID:Neojin9,项目名称:RLRedux,代码行数:7,代码来源:TerrainObj.cs

示例2: Draw

 public override void Draw(Camera2D camera)
 {
     this.m_mountain1.X = camera.TopLeftCorner.X * 0.5f;
     this.m_mountain2.X = this.m_mountain1.X + 2640f;
     base.Draw(camera);
     camera.Draw(Game.GenericTexture, new Rectangle(0, 0, 2640, 720), Color.Black * 0.6f);
     foreach (RaindropObj current in this.m_rainFG)
     {
         current.Draw(camera);
     }
     if (this.m_inSecondPart)
     {
         camera.Draw(Game.GenericTexture, new Rectangle(1650, 0, 3000, 720), Color.Black);
     }
 }
开发者ID:Neojin9,项目名称:RLRedux,代码行数:15,代码来源:IntroRoomObj.cs

示例3: Draw

 public override void Draw(Camera2D camera)
 {
     this.m_moon.X = this.m_moonPos.X - camera.TopLeftCorner.X * 0.01f;
     this.m_moon.Y = this.m_moonPos.Y - camera.TopLeftCorner.Y * 0.01f;
     camera.GraphicsDevice.Clear(new Color(4, 29, 86));
     camera.Draw(Game.GenericTexture, new Rectangle(-10, -10, 1400, 800), Color.SkyBlue * this.MorningOpacity);
     this.m_moon.Opacity = 1f - this.MorningOpacity;
     this.m_silhouette.Opacity = 1f - this.MorningOpacity;
     this.m_differenceCloud.Opacity = 1f - this.MorningOpacity;
     this.m_differenceCloud2.Opacity = 1f - this.MorningOpacity;
     this.m_differenceCloud3.Opacity = this.MorningOpacity;
     this.m_moon.Draw(camera);
     this.m_differenceCloud.Draw(camera);
     this.m_differenceCloud2.Draw(camera);
     this.m_differenceCloud3.Draw(camera);
     this.m_silhouette.Draw(camera);
     base.Draw(camera);
 }
开发者ID:Neojin9,项目名称:RLRedux,代码行数:18,代码来源:SkyObj.cs

示例4: Draw

 public override void Draw(Camera2D camera)
 {
     if (base.Visible)
     {
         camera.End();
         camera.GraphicsDevice.Textures[1] = this.m_alphaMaskRT;
         camera.GraphicsDevice.SamplerStates[1] = SamplerState.LinearClamp;
         camera.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, Game.MaskEffect);
         if (!this.DrawNothing)
         {
             camera.Draw(this.m_mapScreenRT, Vector2.Zero, Color.White);
         }
         camera.End();
         camera.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, null, null, null);
         if (this.DrawNothing)
         {
             this.m_playerSprite.Draw(camera);
         }
     }
 }
开发者ID:Neojin9,项目名称:RLRedux,代码行数:20,代码来源:MapObj.cs

示例5: Draw

 public override void Draw(Camera2D camera)
 {
     Texture2D texture2D = this.BorderTexture;
     if (Game.PlayerStats.Traits.X == 32f || Game.PlayerStats.Traits.Y == 32f)
     {
         this.TextureOffset = Vector2.Zero;
         texture2D = this.NeoTexture;
     }
     if (this.BorderBottom)
     {
         camera.Draw(texture2D, new Vector2((float)(this.Bounds.Right - this.CornerTexture.Width) + this.TextureOffset.X, (float)this.Bounds.Bottom - this.TextureOffset.Y), new Rectangle?(new Rectangle(0, 0, (int)((float)this.Width / this.TextureScale.X) - this.CornerTexture.Width * 2, texture2D.Height)), base.TextureColor, MathHelper.ToRadians(180f), Vector2.Zero, this.TextureScale, SpriteEffects.None, 0f);
     }
     if (this.BorderLeft)
     {
         camera.Draw(texture2D, new Vector2(base.X + this.TextureOffset.Y, (float)(this.Bounds.Bottom - this.CornerTexture.Width) - this.TextureOffset.X), new Rectangle?(new Rectangle(0, 0, (int)((float)this.Height / this.TextureScale.Y) - this.CornerTexture.Width * 2, texture2D.Height)), base.TextureColor, MathHelper.ToRadians(-90f), Vector2.Zero, this.TextureScale, SpriteEffects.None, 0f);
     }
     if (this.BorderRight)
     {
         camera.Draw(texture2D, new Vector2((float)this.Bounds.Right - this.TextureOffset.Y, base.Y + (float)this.CornerTexture.Width + this.TextureOffset.X), new Rectangle?(new Rectangle(0, 0, (int)((float)this.Height / this.TextureScale.Y) - this.CornerTexture.Width * 2, texture2D.Height)), base.TextureColor, MathHelper.ToRadians(90f), Vector2.Zero, this.TextureScale, SpriteEffects.None, 0f);
     }
     if (this.BorderTop)
     {
         if (base.Rotation == 0f)
         {
             camera.Draw(texture2D, new Vector2(base.X + (float)this.CornerTexture.Width + this.TextureOffset.X, base.Y + this.TextureOffset.Y), new Rectangle?(new Rectangle(0, 0, (int)((float)this.Width / this.TextureScale.X) - this.CornerTexture.Width * 2, texture2D.Height)), base.TextureColor, MathHelper.ToRadians(base.Rotation), Vector2.Zero, this.TextureScale, SpriteEffects.None, 0f);
         }
         else
         {
             Vector2 position = CollisionMath.UpperLeftCorner(new Rectangle((int)base.X, (int)base.Y, this._width, this._height), base.Rotation, Vector2.Zero);
             Vector2 position2 = CollisionMath.UpperRightCorner(new Rectangle((int)base.X, (int)base.Y, this._width, this._height), base.Rotation, Vector2.Zero);
             if (base.Rotation > 0f && base.Rotation < 80f)
             {
                 this.CornerTexture.Flip = SpriteEffects.FlipHorizontally;
                 this.CornerTexture.Position = position;
                 this.CornerTexture.Rotation = 0f;
                 this.CornerTexture.Draw(camera);
                 this.CornerTexture.Flip = SpriteEffects.None;
                 this.CornerTexture.Position = new Vector2(position2.X - (float)this.CornerTexture.Width / 2f, position2.Y);
                 this.CornerTexture.Rotation = 0f;
                 this.CornerTexture.Draw(camera);
             }
             if (base.Rotation < 0f && base.Rotation > -80f)
             {
                 this.CornerTexture.Flip = SpriteEffects.FlipHorizontally;
                 this.CornerTexture.Position = position;
                 this.CornerTexture.X += (float)this.CornerTexture.Width / 2f;
                 this.CornerTexture.Rotation = 0f;
                 this.CornerTexture.Draw(camera);
                 this.CornerTexture.Flip = SpriteEffects.None;
                 this.CornerTexture.Position = position2;
                 this.CornerTexture.Rotation = 0f;
                 this.CornerTexture.Draw(camera);
             }
             camera.Draw(texture2D, new Vector2(base.X + this.TextureOffset.X - (float)Math.Sin((double)MathHelper.ToRadians(base.Rotation)) * this.TextureOffset.Y, base.Y + (float)Math.Cos((double)MathHelper.ToRadians(base.Rotation)) * this.TextureOffset.Y), new Rectangle?(new Rectangle(0, 0, (int)((float)this.Width / this.TextureScale.X), texture2D.Height)), base.TextureColor, MathHelper.ToRadians(base.Rotation), Vector2.Zero, this.TextureScale, SpriteEffects.None, 0f);
         }
     }
     base.Draw(camera);
 }
开发者ID:Neojin9,项目名称:RLRedux,代码行数:58,代码来源:BorderObj.cs

示例6: DrawDetectionRadii

 public void DrawDetectionRadii(Camera2D camera)
 {
     camera.Draw(this.m_engageRadiusTexture, new Vector2(base.Position.X - (float)this.EngageRadius, base.Position.Y - (float)this.EngageRadius), Color.Red * 0.5f);
     camera.Draw(this.m_projectileRadiusTexture, new Vector2(base.Position.X - (float)this.ProjectileRadius, base.Position.Y - (float)this.ProjectileRadius), Color.Blue * 0.5f);
     camera.Draw(this.m_meleeRadiusTexture, new Vector2(base.Position.X - (float)this.MeleeRadius, base.Position.Y - (float)this.MeleeRadius), Color.Green * 0.5f);
 }
开发者ID:Neojin9,项目名称:RLRedux,代码行数:6,代码来源:EnemyObj.cs

示例7: Draw

 public void Draw(RenderTarget2D srcTexture, Camera2D Camera, RenderTarget2D mask = null)
 {
     if (this.effect == null)
     {
         throw new InvalidOperationException("GaussianBlur.fx effect not loaded.");
     }
     Camera.GraphicsDevice.SetRenderTarget(this.m_renderHolder);
     this.m_offsetParameters.SetValue(this.offsetsHoriz);
     if (mask != null)
     {
         Camera.GraphicsDevice.Textures[1] = mask;
         Camera.GraphicsDevice.SamplerStates[1] = SamplerState.LinearClamp;
     }
     Camera.Begin(SpriteSortMode.Deferred, BlendState.Opaque, SamplerState.LinearClamp, null, null, this.effect);
     if (LevelEV.SAVE_FRAMES)
     {
         Camera.Draw(srcTexture, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, new Vector2(0.5f, 0.5f), SpriteEffects.None, 1f);
     }
     else
     {
         Camera.Draw(srcTexture, Vector2.Zero, Color.White);
     }
     Camera.End();
     if (LevelEV.SAVE_FRAMES)
     {
         Camera.GraphicsDevice.SetRenderTarget(this.m_renderHolder2);
         this.m_offsetParameters.SetValue(this.offsetsVert);
         if (mask != null)
         {
             Camera.GraphicsDevice.Textures[1] = mask;
         }
         Camera.Begin(SpriteSortMode.Deferred, BlendState.Opaque, null, null, null, this.effect);
         Camera.Draw(this.m_renderHolder, Vector2.Zero, Color.White);
         Camera.End();
         Camera.GraphicsDevice.SetRenderTarget(srcTexture);
         Camera.Begin(SpriteSortMode.Deferred, BlendState.Opaque, SamplerState.PointClamp, null, null);
         Camera.Draw(this.m_renderHolder2, Vector2.Zero, null, Color.White, 0f, Vector2.Zero, new Vector2(2f, 2f), SpriteEffects.None, 1f);
         Camera.End();
         return;
     }
     Camera.GraphicsDevice.SetRenderTarget(srcTexture);
     this.m_offsetParameters.SetValue(this.offsetsVert);
     if (mask != null)
     {
         Camera.GraphicsDevice.Textures[1] = mask;
     }
     Camera.Begin(SpriteSortMode.Deferred, BlendState.Opaque, null, null, null, this.effect);
     Camera.Draw(this.m_renderHolder, Vector2.Zero, Color.White);
     Camera.End();
 }
开发者ID:Neojin9,项目名称:RLRedux,代码行数:50,代码来源:GaussianBlur.cs

示例8: Draw

 public override void Draw(Camera2D camera)
 {
     base.Draw(camera);
     camera.Draw(Game.GenericTexture, new Rectangle((int)base.X, (int)base.Y, this.Width, this.Height), Color.White * this.BackBufferOpacity);
 }
开发者ID:Neojin9,项目名称:RLRedux,代码行数:5,代码来源:LastBossRoom.cs


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