本文整理汇总了C#中Window.SetPostProcessingEffect方法的典型用法代码示例。如果您正苦于以下问题:C# Window.SetPostProcessingEffect方法的具体用法?C# Window.SetPostProcessingEffect怎么用?C# Window.SetPostProcessingEffect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Window
的用法示例。
在下文中一共展示了Window.SetPostProcessingEffect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
//.........这里部分代码省略.........
600, 300
};
colouredTriangle.UpdateVertex();
colouredTriangle.vc = new float[]
{
1, 0, 0, 0.5f,
0, 1, 0, 0.5f,
0, 0, 1, 0.5f
};
colouredTriangle.UpdateVertexColor();
Texture alien2 = new Texture("aiv_fast2d_example.Assets.2.png");
RenderTexture maskedAlien = new RenderTexture(alien2.Width, alien2.Height);
Sprite spriteMask = new Sprite(50, 50);
Texture circleMask = new Texture("aiv_fast2d_example.Assets.mask_circle.png");
Texture circleMask2 = new Texture("aiv_fast2d_example.Assets.mask_circle2.png");
Sprite maskedObject = new Sprite(alien2.Width, alien2.Height);
maskedObject.position = new Vector2(200, 200);
Sprite maskedBackground = new Sprite(alien2.Width, alien2.Height);
PostProcessingEffect mainEffect = window.AddPostProcessingEffect(new GrayscaleEffect());
mainEffect.enabled = false;
window.AddPostProcessingEffect(new MaskEffect("aiv_fast2d_example.Assets.mask_circle.png"));
window.AddPostProcessingEffect(new BlackBands());
window.AddPostProcessingEffect(new RedBands());
// insert a postprocessing effect at the specific position
window.SetPostProcessingEffect(1, new WASDEffect());
window.SetPostProcessingEffect(1, new WobbleEffect(5));
Tilemap tileMap = new Tilemap("Assets/map001.csv", "Assets/tiles_spritesheet.png");
while (window.opened)
{
if (window.GetKey(KeyCode.Right))
{
tileMap.position += new Vector2(1, 0) * window.deltaTime * 300;
}
if (window.GetKey(KeyCode.Left))
{
tileMap.position += new Vector2(-1, 0) * window.deltaTime * 300;
}
if (window.GetKey(KeyCode.Up))
{
tileMap.position += new Vector2(0, -1) * window.deltaTime * 300;
}
if (window.GetKey(KeyCode.Down))
{
tileMap.position += new Vector2(0, 1) * window.deltaTime * 300;
}
tileMap.position += window.JoystickAxisRight(0) * window.deltaTime * 300;
tileMap.Draw();
for (int i = 0; i < tiles2.Instances; i++)
{
tiles2.SetPosition(i, new Vector2(20 * i, 20 * i), true);
if (i % 2 == 0)