本文整理汇总了C#中Window.AddPostProcessingEffect方法的典型用法代码示例。如果您正苦于以下问题:C# Window.AddPostProcessingEffect方法的具体用法?C# Window.AddPostProcessingEffect怎么用?C# Window.AddPostProcessingEffect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Window
的用法示例。
在下文中一共展示了Window.AddPostProcessingEffect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GameSetup
private void GameSetup(Window window)
{
window.SetClearColor(0f, 1f, 1f);
mesh001 = new Mesh();
mesh001.v = new float[]
{
100, 100,
50, 200,
150, 200
};
mesh001.UpdateVertex();
alienTexture = new Texture("Assets/2.png");
alien = new Sprite(alienTexture.Width, alienTexture.Height);
window.AddPostProcessingEffect(new GrayscaleEffect());
}
示例2: Main
//.........这里部分代码省略.........
300, 500,
500, 500
};
farTriangles.UpdateVertex();
Mesh colouredTriangle = new Mesh();
colouredTriangle.v = new float[]
{
500, 200,
400, 300,
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;