本文整理汇总了C#中Camera2D.Begin方法的典型用法代码示例。如果您正苦于以下问题:C# Camera2D.Begin方法的具体用法?C# Camera2D.Begin怎么用?C# Camera2D.Begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Camera2D
的用法示例。
在下文中一共展示了Camera2D.Begin方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
public override void Draw(Camera2D camera)
{
if (this.m_boss.IsKilled && Game.PlayerStats.Traits.X != 1f && Game.PlayerStats.Traits.Y != 1f)
{
camera.End();
this.m_boss.StopAnimation();
Game.HSVEffect.Parameters["Saturation"].SetValue(0);
camera.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointWrap, null, null, Game.HSVEffect, camera.GetTransformation());
this.m_boss.Visible = true;
this.m_boss.Draw(camera);
this.m_boss.Visible = false;
camera.End();
camera.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointWrap, null, null, null, camera.GetTransformation());
}
base.Draw(camera);
}
示例2: Draw
public void Draw(Camera2D camera, GameTime gameTime)
{
if (PreSteps.Count > 0)
foreach (var s in PreSteps)
s(camera, this, gameTime);
if (Skip)
return;
camera.GraphicsDevice.SetRenderTarget(RenderTarget);
if (ClearColor != null)
camera.GraphicsDevice.Clear(ClearColor.Value);
if (ShaderSteps.Count > 0)
foreach (var s in ShaderSteps)
s.Prepare(camera);
camera.Begin(SpriteSortMode, BlendState, SamplerState, DepthStencilState, RasterizerState, Effect, TransformMatrix);
if (DrawSteps.Count > 0)
foreach (var s in DrawSteps)
s(camera, this, gameTime);
camera.End();
}
示例3: Draw
public override void Draw(Camera2D camera)
{
this.m_continueText.Position = new Vector2((float)(camera.Bounds.Right - 50), (float)(camera.Bounds.Bottom - 70));
this.m_endingMask.Position = camera.Position - new Vector2(660f, 360f);
this.m_endingMask.Draw(camera);
if (camera.X > this.m_background.X + 6600f)
{
this.m_background.X = camera.X;
}
if (camera.X < this.m_background.X)
{
this.m_background.X = camera.X - 1320f;
}
this.m_background.Draw(camera);
foreach (SpriteObj current in this.m_frameList)
{
current.Draw(camera);
}
foreach (SpriteObj current2 in this.m_plaqueList)
{
current2.Draw(camera);
}
base.Draw(camera);
camera.End();
if (!LevelEV.SHOW_ENEMY_RADII)
{
camera.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, null, null, null, camera.GetTransformation());
}
else
{
camera.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, null, null, null, camera.GetTransformation());
}
foreach (TextObj current3 in this.m_nameList)
{
current3.Draw(camera);
}
foreach (TextObj current4 in this.m_slainCountText)
{
current4.Draw(camera);
}
this.m_continueText.Draw(camera);
camera.End();
if (!LevelEV.SHOW_ENEMY_RADII)
{
camera.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointWrap, null, null, null, camera.GetTransformation());
return;
}
camera.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointWrap, null, null, null, camera.GetTransformation());
}
示例4: InitializeAlphaMap
public void InitializeAlphaMap(Rectangle mapSize, Camera2D camera)
{
this.m_alphaMaskRect = mapSize;
this.m_mapScreenRT = new RenderTarget2D(camera.GraphicsDevice, 1320, 720);
this.m_alphaMaskRT = new RenderTarget2D(camera.GraphicsDevice, 1320, 720);
this.CameraOffset = new Vector2((float)mapSize.X, (float)mapSize.Y);
SpriteObj spriteObj = new SpriteObj("MapMask_Sprite");
spriteObj.ForceDraw = true;
spriteObj.Position = new Vector2((float)mapSize.X, (float)mapSize.Y);
spriteObj.Scale = new Vector2((float)mapSize.Width / (float)spriteObj.Width, (float)mapSize.Height / (float)spriteObj.Height);
camera.GraphicsDevice.SetRenderTarget(this.m_alphaMaskRT);
camera.GraphicsDevice.Clear(Color.White);
camera.Begin();
spriteObj.Draw(camera);
camera.End();
camera.GraphicsDevice.SetRenderTarget(Game.ScreenManager.RenderTarget);
}
示例5: 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);
}
}
}
示例6: 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();
}
示例7: Draw
public override void Draw(Camera2D camera)
{
if (this.FlipPortrait)
{
this.m_playerSprite.Rotation = 180f;
}
if (!this.m_frameDropping)
{
this.m_frameSprite.Position = base.Position;
this.m_frameSprite.Y -= 12f;
this.m_frameSprite.X += 5f;
}
this.m_frameSprite.Opacity = base.Opacity;
this.m_frameSprite.Draw(camera);
if (!this.IsDead && this.Spell != 0)
{
this.m_spellIconHolder.Position = new Vector2(this.m_frameSprite.X, (float)(this.m_frameSprite.Bounds.Bottom - 20));
this.m_spellIcon.Position = this.m_spellIconHolder.Position;
this.m_spellIconHolder.Draw(camera);
this.m_spellIcon.Draw(camera);
}
this.m_playerSprite.OutlineColour = this.OutlineColour;
this.m_playerSprite.OutlineWidth = base.OutlineWidth;
if (!this.m_frameDropping)
{
this.m_playerSprite.Position = base.Position;
this.m_playerSprite.X += 10f;
if (this.FlipPortrait)
{
this.m_playerSprite.X -= 10f;
this.m_playerSprite.Y -= 30f;
}
}
this.m_playerSprite.Opacity = base.Opacity;
this.m_playerSprite.Draw(camera);
if (CollisionMath.Intersects(this.Bounds, camera.Bounds))
{
if (this.Class == 7 || this.Class == 15)
{
Game.ColourSwapShader.Parameters["desiredTint"].SetValue(Color.White.ToVector4());
Game.ColourSwapShader.Parameters["Opacity"].SetValue(this.m_playerSprite.Opacity);
Game.ColourSwapShader.Parameters["ColourSwappedOut1"].SetValue(this.m_skinColour1.ToVector4());
Game.ColourSwapShader.Parameters["ColourSwappedIn1"].SetValue(this.m_lichColour1.ToVector4());
Game.ColourSwapShader.Parameters["ColourSwappedOut2"].SetValue(this.m_skinColour2.ToVector4());
Game.ColourSwapShader.Parameters["ColourSwappedIn2"].SetValue(this.m_lichColour2.ToVector4());
camera.End();
camera.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, Game.ColourSwapShader, camera.GetTransformation());
this.m_playerSprite.GetChildAt(12).Draw(camera);
camera.End();
camera.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, camera.GetTransformation());
if (this.IsFemale)
{
this.m_playerSprite.GetChildAt(13).Draw(camera);
}
this.m_playerSprite.GetChildAt(15).Draw(camera);
}
else if (this.Class == 3 || this.Class == 11)
{
Game.ColourSwapShader.Parameters["desiredTint"].SetValue(Color.White.ToVector4());
Game.ColourSwapShader.Parameters["Opacity"].SetValue(this.m_playerSprite.Opacity);
Game.ColourSwapShader.Parameters["ColourSwappedOut1"].SetValue(this.m_skinColour1.ToVector4());
Game.ColourSwapShader.Parameters["ColourSwappedIn1"].SetValue(Color.Black.ToVector4());
Game.ColourSwapShader.Parameters["ColourSwappedOut2"].SetValue(this.m_skinColour2.ToVector4());
Game.ColourSwapShader.Parameters["ColourSwappedIn2"].SetValue(Color.Black.ToVector4());
camera.End();
camera.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, Game.ColourSwapShader, camera.GetTransformation());
this.m_playerSprite.GetChildAt(12).Draw(camera);
camera.End();
camera.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, camera.GetTransformation());
if (this.IsFemale)
{
this.m_playerSprite.GetChildAt(13).Draw(camera);
}
this.m_playerSprite.GetChildAt(15).Draw(camera);
}
}
if (!this.DisablePlaque)
{
if (!this.m_frameDropping)
{
this.m_plaqueSprite.Position = base.Position;
this.m_plaqueSprite.X += 5f;
this.m_plaqueSprite.Y = this.m_frameSprite.Y + (float)this.m_frameSprite.Height - 30f;
}
this.m_plaqueSprite.Draw(camera);
camera.GraphicsDevice.SamplerStates[0] = SamplerState.LinearClamp;
base.Draw(camera);
camera.GraphicsDevice.SamplerStates[0] = SamplerState.PointClamp;
}
if (this.m_frameDropping)
{
this.m_frameSprite.Draw(camera);
this.m_playerSprite.Draw(camera);
}
}
示例8: Draw
public override void Draw(Camera2D camera)
{
this.m_swearBubble.Scale = new Vector2(this.ScaleX * 1.2f, this.ScaleY * 1.2f);
this.m_swearBubble.Position = new Vector2(base.X - 30f * this.ScaleX, base.Y - 35f * this.ScaleX);
this.m_swearBubble.Draw(camera);
this.m_translocatorSprite.Draw(camera);
base.Draw(camera);
if (this.IsFlying && base.State != 9)
{
this.m_flightDurationText.Text = string.Format("{0:F1}", this.m_flightCounter);
this.m_flightDurationText.Position = new Vector2(base.X, (float)(this.TerrainBounds.Top - 70));
this.m_flightDurationText.Draw(camera);
}
camera.End();
Game.ColourSwapShader.Parameters["desiredTint"].SetValue(this.m_playerHead.TextureColor.ToVector4());
if (Game.PlayerStats.Class == 7 || Game.PlayerStats.Class == 15)
{
Game.ColourSwapShader.Parameters["Opacity"].SetValue(base.Opacity);
Game.ColourSwapShader.Parameters["ColourSwappedOut1"].SetValue(this.m_skinColour1.ToVector4());
Game.ColourSwapShader.Parameters["ColourSwappedIn1"].SetValue(this.m_lichColour1.ToVector4());
Game.ColourSwapShader.Parameters["ColourSwappedOut2"].SetValue(this.m_skinColour2.ToVector4());
Game.ColourSwapShader.Parameters["ColourSwappedIn2"].SetValue(this.m_lichColour2.ToVector4());
}
else if (Game.PlayerStats.Class == 3 || Game.PlayerStats.Class == 11)
{
Game.ColourSwapShader.Parameters["Opacity"].SetValue(base.Opacity);
Game.ColourSwapShader.Parameters["ColourSwappedOut1"].SetValue(this.m_skinColour1.ToVector4());
Game.ColourSwapShader.Parameters["ColourSwappedIn1"].SetValue(Color.Black.ToVector4());
Game.ColourSwapShader.Parameters["ColourSwappedOut2"].SetValue(this.m_skinColour2.ToVector4());
Game.ColourSwapShader.Parameters["ColourSwappedIn2"].SetValue(Color.Black.ToVector4());
}
else
{
Game.ColourSwapShader.Parameters["Opacity"].SetValue(base.Opacity);
Game.ColourSwapShader.Parameters["ColourSwappedOut1"].SetValue(this.m_skinColour1.ToVector4());
Game.ColourSwapShader.Parameters["ColourSwappedIn1"].SetValue(this.m_skinColour1.ToVector4());
Game.ColourSwapShader.Parameters["ColourSwappedOut2"].SetValue(this.m_skinColour2.ToVector4());
Game.ColourSwapShader.Parameters["ColourSwappedIn2"].SetValue(this.m_skinColour2.ToVector4());
}
camera.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, Game.ColourSwapShader, camera.GetTransformation());
this.m_playerHead.Draw(camera);
camera.End();
camera.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, camera.GetTransformation());
if (Game.PlayerStats.IsFemale)
{
this._objectList[13].Draw(camera);
}
this._objectList[14].Draw(camera);
this._objectList[15].Draw(camera);
}