本文整理汇总了C#中Camera2D.GetParallaxMatrix方法的典型用法代码示例。如果您正苦于以下问题:C# Camera2D.GetParallaxMatrix方法的具体用法?C# Camera2D.GetParallaxMatrix怎么用?C# Camera2D.GetParallaxMatrix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Camera2D
的用法示例。
在下文中一共展示了Camera2D.GetParallaxMatrix方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateParallax
public void UpdateParallax(Camera2D _camera)
{
Matrix pos = _camera.GetParallaxMatrix(_speed);
if (_camera.IsPlayerFollow)
{
_position.X = -pos.M41 - (int)-pos.M41 % _width;
_position2.X = _position.X + _width;
}
else
{
if (-pos.M41 > _position2.X + -_camera.Translation.X &&
-pos.M41 < _position2.X + _width)
_position.X = _position2.X + _width;
else
_position.X = _position2.X - _width;
if (-pos.M41 > _position.X + -_camera.Translation.X &&
-pos.M41 < _position.X + _width)
_position2.X = _position.X + _width;
else
_position2.X = _position.X - _width;
}
_position.Y = -pos.M42;
_position2.Y = -pos.M42;
}
示例2: DrawParallax
protected void DrawParallax(SpriteBatch spriteBatch, Camera2D _camera)
{
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, null, null, null, null, _camera.GetParallaxMatrix(_speed));
spriteBatch.Draw(TextureManager.Instance.GetParallax(_textureName), _position, Color.White);
spriteBatch.Draw(TextureManager.Instance.GetParallax(_textureName), _position2, Color.White);
spriteBatch.End();
}
示例3: Draw
public void Draw(SpriteBatch spriteBatch, Camera2D pCamera)
{
if (_textureName == "") return;
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, null, null, null, null, pCamera.GetParallaxMatrix(_speed));
spriteBatch.Draw(TextureManager.Instance.GetParallax(_textureName), _position, Color.White);
if(!_isMoving)
spriteBatch.Draw(TextureManager.Instance.GetParallax(_textureName), _position2, Color.White);
spriteBatch.End();
}
示例4: Draw
public void Draw(SpriteBatch spriteBatch, Camera2D camera, float pSpeed)
{
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, null, null, null, null, camera.GetParallaxMatrix(pSpeed));
foreach (Partikel p in _partikelList)
{
_shader.CurrentTechnique.Passes[0].Apply();
_shader.Parameters["_colorTex"].SetValue(p.DrawColor.ToVector4());
p.Draw(spriteBatch);
}
spriteBatch.End();
}