本文整理汇总了C#中Combat.SetShader方法的典型用法代码示例。如果您正苦于以下问题:C# Combat.SetShader方法的具体用法?C# Combat.SetShader怎么用?C# Combat.SetShader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Combat
的用法示例。
在下文中一共展示了Combat.SetShader方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
public override void Draw(Combat.PaletteFx palettefx)
{
Point tilestart;
Point tileend;
GetTileLength(Sprite.Size, out tilestart, out tileend);
Video.DrawState drawstate = SpriteManager.DrawState;
drawstate.Reset();
drawstate.Blending = Transparency;
drawstate.ScissorRectangle = DrawRect;
drawstate.Set(Sprite);
for (Int32 y = tilestart.Y; y != tileend.Y; ++y)
{
for (Int32 x = tilestart.X; x != tileend.X; ++x)
{
Vector2 adjustment = (Vector2)(Sprite.Size + TilingSpacing) * new Vector2(x, y);
Vector2 location = CurrentLocation + adjustment;
drawstate.AddData(location, null);
}
}
if (palettefx != null) palettefx.SetShader(drawstate.ShaderParameters);
drawstate.Use();
}
示例2: Draw
public override void Draw(Combat.PaletteFx palettefx)
{
Drawing.Sprite sprite = SpriteManager.GetSprite(AnimationManager.CurrentElement.SpriteId);
if (sprite == null) return;
Point tilestart;
Point tileend;
GetTileLength(sprite.Size, out tilestart, out tileend);
Video.DrawState drawstate = SpriteManager.DrawState;
drawstate.Reset();
drawstate.Blending = Transparency;
drawstate.Set(sprite);
drawstate.AddData(CurrentLocation, null);
if (palettefx != null) palettefx.SetShader(drawstate.ShaderParameters);
drawstate.Use();
}