本文整理汇总了C#中Renderer.End方法的典型用法代码示例。如果您正苦于以下问题:C# Renderer.End方法的具体用法?C# Renderer.End怎么用?C# Renderer.End使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Renderer
的用法示例。
在下文中一共展示了Renderer.End方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
public override void Draw(Renderer renderer)
{
if (!isVisible) return;
if (image == null)
{
base.Draw(renderer);
return;
}
renderer.Draw(image, new Rectangle((int)position.X, (int)position.Y, (int)size.X, (int)size.Y),
Color.White);
if (!isEnabled)
{
renderer.Draw(GraphicsEngine.pixel,
new Rectangle((int)position.X + 2, (int)position.Y + 2, (int)size.X - 4, (int)size.Y - 4),
Shortcuts.BG_COLOR * 0.5f);
}
renderer.End();
renderer.BeginUnscaled(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearWrap,
DepthStencilState.Default, RasterizerState.CullNone);
renderer.Draw(overPattern,
new Rectangle((int)position.X + 2, (int)position.Y + 2, (int)size.X - 4, (int)size.Y - 4),
new Rectangle((int)position.X + 2, (int)position.Y + 2, (int)size.X - 4, (int)size.Y - 4),
Color.White * HighlightForce);
renderer.End();
renderer.BeginUnscaled();
}
示例2: Draw
public override void Draw(Renderer r)
{
r.End();
_setUpShader();
r.BeginUnscaled(SpriteSortMode.Immediate, BlendState.Additive, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullNone,
Graphics.Effects.Effects.shockWave);
r.Draw(Shortcuts.pixel, new Rectangle(0, 0, Main.WindowWidth, Main.WindowHeight), color * 0.75f);
r.End();
r.Begin();
}
示例3: Draw
public override void Draw(Renderer renderer)
{
renderer.End();
renderer.Begin();
try
{
Components.ComponentsManager.Draw();
}
catch { }
renderer.End();
renderer.BeginUnscaled();
renderer.Draw(GraphicsEngine.pixel, new Rectangle(0, 0, Main.WindowWidth, Main.WindowHeight), new Color(45, 57, 107) * 0.75f);
}
示例4: DrawToFBO
public override void DrawToFBO(Renderer renderer)
{
renderer.BeginUnscaled();
renderer.Draw(GraphicsEngine.pixel,
new Rectangle(0, 0, (int)size.X, (int)size.Y),
isEnabled ? (isPressed ? pressedColor : (isMouseOver ? mouseOverColor : background)) : disabledColor);
if (textOld != Text)
{
textOld = Text;
stringSize = GUIEngine.font.MeasureString(Text);
}
renderer.DrawString(Font, Text, new Rectangle(MouseOverOffset + 10,
(int)size.Y - 22, (int)size.X, (int)size.Y), foreground, textAlignment);
//inside text
String t = Text.Substring(Text.Length - 1);
var a = bfont.MeasureString(t);
renderer.DrawStringLeft(bfont, t, new Vector2(3 + (size.X - 3 - a.X) / 2, 3 + (lines[3].Position.Y - 3 - a.Y) / 2), Color.White);
renderer.Draw(GraphicsEngine.pixel, new Rectangle(0, 0, 0, 0), Color.White);
renderer.DrawLinesList(lines);
renderer.End();
}
示例5: Draw
//TODO animation
public override void Draw(Renderer renderer)
{
renderer.Draw(GraphicsEngine.pixel,
new Rectangle(0, 0, Main.WindowWidth, Main.WindowHeight),
Shortcuts.BG_COLOR * fadeopacity);
bool b = OffsetX != 0;
if (b)
{
renderer.SetScissorRectangle(position.X, position.Y, size.X, size.Y, false);
renderer.End();
renderer.BeginUnscaled(SpriteSortMode.Immediate, BlendState.AlphaBlend, null,
null, Graphics.GraphicsEngine.s_ScissorsOn, null, Matrix.CreateTranslation(OffsetX, 0, 0));
}
RenderHelper.SmartDrawRectangle(bg, 5,
(int)position.X - 2, (int)position.Y - 2, (int)size.X + 4, (int)size.Y - 30 + 4,
Color.White, renderer);
base.Draw(renderer);
renderer.Draw(title, position + new Vector2(64, 64), Color.White);
renderer.Draw(GraphicsEngine.pixel,
new Rectangle((int)(position.X + size.X / 4), (int)(position.Y + size.Y - 30), 1, 30),
Color.White);
renderer.Draw(GraphicsEngine.pixel,
new Rectangle((int)(position.X + size.X / 2), (int)(position.Y + size.Y - 30), 1, 30),
Color.White);
renderer.Draw(GraphicsEngine.pixel,
new Rectangle((int)(position.X + 3 * size.X / 4), (int)(position.Y + size.Y - 30), 1, 30),
Color.White);
if (b)
renderer.ResetScissorRectangle();
}
示例6: DrawToFBO
public void DrawToFBO(Renderer renderer)
{
if (lines.Count > 0 || fadeOutLines.Count > 0)
{
renderer.End();
renderer.Begin();
for (int i = 0; i < lines.Count; i++)
{
renderer.GraphicsDevice.Textures[0] = GraphicsEngine.pixel;
lines[i].Draw(renderer);
}
for (int i = 0; i < fadeOutLines.Count; i++)
{
renderer.GraphicsDevice.Textures[0] = GraphicsEngine.pixel;
fadeOutLines[i].Draw(renderer);
}
renderer.End();
for (int i = 0; i < lines.Count; i++)
{
lines[i].DrawArrow(renderer);
}
for (int i = 0; i < fadeOutLines.Count; i++)
{
fadeOutLines[i].DrawArrow(renderer);
}
renderer.BeginUnscaled();
}
for (int i = 0; i < tooltips.Count; i++)
{
tooltips[i].Draw(renderer);
}
}
示例7: Draw
public override void Draw(Renderer renderer)
{
base.Draw(renderer);
renderer.SetScissorRectangle(GUIEngine.s_mainMenu.line3p1.X, GUIEngine.s_mainMenu.line3p1.Y, Main.WindowWidth, Main.WindowHeight, false);
renderer.End();
renderer.BeginUnscaled(SpriteSortMode.Immediate, BlendState.AlphaBlend, null,
null, Graphics.GraphicsEngine.s_ScissorsOn, null, Matrix.CreateTranslation(MainMenu.FrameOffset, 0, 0));
Vector2 corner = Position + Size;
renderer.Draw(GraphicsEngine.pixel,
new Rectangle((int)(corner.X - 333), (int)(corner.Y - 1),
333, 1), Color.White);
renderer.Draw(GraphicsEngine.pixel,
new Rectangle((int)(corner.X - 1), (int)(corner.Y - (ShortUpperLine ? 29 : 96)),
1, (int)((ShortUpperLine ? 29 : 96) - (ButtonsCount == FrameButtonsCount.Zero ? 0 : 23))), Color.White);
if (ButtonsCount != FrameButtonsCount.Zero)
{
renderer.Draw(GraphicsEngine.pixel,
new Rectangle((int)(corner.X - 120), (int)(corner.Y - 23),
1, 23), Color.White);
int linew = ButtonsCount == FrameButtonsCount.One ? 120 : 240;
renderer.Draw(GraphicsEngine.pixel,
new Rectangle((int)(corner.X - linew), (int)(corner.Y - 24),
linew, 1), Color.White);
}
}
示例8: Draw
public override void Draw(Renderer renderer)
{
#region fadeUpdate
if (isclosing)
{
if (OffsetX > -size.X)
OffsetX -= 15;
if (OffsetX <= -size.X)
{
OffsetX = -(int)size.X;
Close();
}
}
else
{
if (OffsetX < 0)
OffsetX += 15;
}
if (OffsetX > 0)
OffsetX = 0;
fadeopacity = (float)(OffsetX + size.X) / size.X / 2f;
#endregion
lock (compToDraw)
{
renderer.Draw(GraphicsEngine.pixel, new Rectangle(0, 0, Main.WindowWidth, Main.WindowHeight), Shortcuts.BG_COLOR * fadeopacity);
bool b = OffsetX != 0;
if (b)
{
renderer.SetScissorRectangle(pos.X, pos.Y, size.X, size.Y, false);
renderer.End();
renderer.BeginUnscaled(SpriteSortMode.Immediate, BlendState.AlphaBlend, null,
null, Graphics.GraphicsEngine.s_ScissorsOn, null, Matrix.CreateTranslation(OffsetX, 0, 0));
}
RenderHelper.SmartDrawRectangle(GraphicsEngine.bg, 5,
(int)pos.X - 2, (int)pos.Y - 2, (int)size.X + 4, (int)size.Y - 30 + 4,
Color.White, renderer);
int x = 5;
int y = 30;
for (int i = 0; i < compToDraw.Count; i++)
{
compToDraw[i].DrawAt((int)pos.X + x, (int)pos.Y + y, renderer);
x += 50;
if (x + 50 >= size.X)
{
x = 0;
y += 50;
}
}
base.Draw(renderer);
if (b)
renderer.ResetScissorRectangle();
}
}
示例9: BeginGaussianBlur
public static void BeginGaussianBlur(int radius, float viewportWidth, float viewportHeight, Renderer renderer)
{
if (radius < 1)
radius = 1;
if (renderer.IsDrawing)
renderer.End();
float[] pixelSize = new float[] { 1f / viewportWidth, 1f / viewportHeight };
if (radius > 5)
{
pixelSize[0] *= radius / 5;
pixelSize[1] *= radius / 5;
radius = 5;
}
//Pascal's triangle
float[] kernel = new float[radius * 2 + 1];
float[] t = new float[kernel.Length];
float[] p;
t[0] = 1;
kernel[0] = 1;
kernel[1] = 1;
for (int i = 2; i < kernel.Length; i++)
{
for (int j = 1; j < i; j++)
t[j] = kernel[j] + kernel[j - 1];
t[i] = 1;
p = t;
t = kernel;
kernel = p;
}
float sum = 1;
for (int i = 1; i < kernel.Length; i++)
sum += kernel[i];
for (int i = 0; i < kernel.Length; i++)
kernel[i] /= sum;
//actual shader setup
Matrix projection = Matrix.CreateOrthographicOffCenter(0, viewportWidth, viewportHeight, 0, 0, 1);
Matrix halfPixelOffset = Matrix.CreateTranslation(-0.5f, -0.5f, 0);
gaussianBlur.Parameters["MatrixTransform"].SetValue(renderer.GetTransformMatrix() * halfPixelOffset * projection);
gaussianBlur.Parameters["range"].SetValue(radius);
gaussianBlur.Parameters["pixelSize"].SetValue(pixelSize);
gaussianBlur.Parameters["kernel"].SetValue(kernel);
renderer.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointWrap, DepthStencilState.None, RasterizerState.CullNone, gaussianBlur);
}
示例10: Draw
public void Draw(Renderer renderer)
{
var vr = MicroWorld.Graphics.GraphicsEngine.camera.VisibleRectangle;
Matrix projection = Matrix.CreateOrthographicOffCenter(vr.X, vr.X + vr.Width, vr.Y + vr.Height, vr.Y, 0, 1);
MicroWorld.Graphics.GraphicsEngine.ComponentFadeEffect.Parameters["MatrixTransform"].SetValue(projection);
MicroWorld.Graphics.GraphicsEngine.ComponentFadeEffect.Parameters["halfpixel"].SetValue(
new float[] { 0.5f / vr.Width, 0.5f / vr.Height });
MicroWorld.Graphics.GraphicsEngine.ComponentFadeEffect.Parameters["Opacity"].SetValue(
(float)(AliveState < 10 ? (float)AliveState / 10f :
(float)(10 - (AliveState - 10)) / 10f));
MicroWorld.Graphics.GraphicsEngine.ComponentFadeEffect.Parameters["Drawtex"].SetValue(
AliveState >= 10);
renderer.Begin(SpriteSortMode.Immediate, BlendState.Additive, SamplerState.PointWrap, DepthStencilState.None, RasterizerState.CullNone,
MicroWorld.Graphics.GraphicsEngine.ComponentFadeEffect);
//renderer.Draw(fbo, new Vector2(), Color.White);
g.Draw(renderer);
renderer.End();
}
示例11: Draw
public override void Draw(Renderer renderer)
{
int dotOutIndex = -1;
for (int i = 0; i < rootTiles.Count; i++)
{
if (rootTiles[i] is CSFolder && (rootTiles[i] as CSFolder).IsOpened)
{
dotOutIndex = i;
break;
}
}
if (dotOutIndex != -1)
{
dotOverlayOpacity += 0.1f;
if (dotOverlayOpacity > 1)
dotOverlayOpacity = 1;
}
else
{
if (dotOverlayOpacity > 0)
dotOverlayOpacity -= 0.1f;
}
//bg
RenderHelper.SmartDrawRectangle(bg, 8, 0, 0, 48, Main.WindowHeight, Color.White, renderer);
if (dotOutIndex != -1 || dotOverlayOpacity > 0)
{
renderer.End();
renderer.BeginUnscaled(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearWrap, DepthStencilState.None,
RasterizerState.CullNone);
renderer.Draw(dotOverlay,
new Rectangle(2, 2, 44, Main.WindowHeight - 4),
new Rectangle(2, 2, 44, Main.WindowHeight - 4),
Color.White * dotOverlayOpacity);
}
//components
for (int i = 0; i < rootTiles.Count; i++)
{
rootTiles[i].Draw(renderer);
if ((dotOutIndex != -1 || dotOverlayOpacity > 0) && dotOutIndex != i)
{
renderer.Draw(dotOverlay,
new Rectangle((int)rootTiles[i].position.X, (int)rootTiles[i].position.Y, CSTile.SIZE_X, CSTile.SIZE_Y),
new Rectangle((int)rootTiles[i].position.X, (int)rootTiles[i].position.Y, CSTile.SIZE_X, CSTile.SIZE_Y),
Color.White * dotOverlayOpacity);
}
}
//selected overlay
if (selectedComponent != null)
{
renderer.Draw(Selected, new Rectangle((int)selectedComponent.position.X, (int)selectedComponent.position.Y,
CSTile.SIZE_X, CSComponent.SIZE_Y), Color.White);
}
}
示例12: Draw
public override void Draw(Renderer renderer)
{
if (background != null && (Main.CurState.StartsWith("GUI") ||
(currentState.items.Count > 0 && currentState.items[0] != inGameItems[0] && currentState.items[0] != inGameItems[4].Children[0] &&
currentState.caption != "HANDBOOK")))
{
gameBGOpacity = 0;
background.Draw(renderer);
var atr = GUIEngine.font.MeasureString(currentTip);
renderer.DrawString(GUIEngine.font, ">> " + currentTip + " <<", new Rectangle(0, (int)(Main.WindowHeight - atr.Y), Main.WindowWidth, (int)atr.Y),
new Color(180, 255, 180), Renderer.TextAlignment.Center);
}
else
{
if (gameBGOpacity < 0.5f)
gameBGOpacity += 0.02f;
renderer.Draw(MicroWorld.Graphics.GraphicsEngine.pixel, new Rectangle(0, 0, Main.WindowWidth, Main.WindowHeight),
new Color(45, 57, 107) * gameBGOpacity);
}
renderer.Draw(GraphicsEngine.pixel, new Rectangle(0, 0, 0, 0), Color.White);
renderer.DrawLinesList(new VertexPositionColorTexture[]{
new VertexPositionColorTexture(new Vector3(line1p1.X, line1p1.Y,0), Color.White, new Vector2()),
new VertexPositionColorTexture(new Vector3(line1p2.X, line1p2.Y, 0), Color.White, new Vector2()),
new VertexPositionColorTexture(new Vector3(line2p1.X, line2p1.Y,0), Color.White, new Vector2()),
new VertexPositionColorTexture(new Vector3(line2p2.X, line2p2.Y, 0), Color.White, new Vector2()),
new VertexPositionColorTexture(new Vector3(line3p1.X, line3p1.Y,0), Color.White, new Vector2()),
new VertexPositionColorTexture(new Vector3(line3p2.X, line3p2.Y, 0), Color.White, new Vector2()),
new VertexPositionColorTexture(new Vector3(line4p1.X, line4p1.Y,0), Color.White, new Vector2()),
new VertexPositionColorTexture(new Vector3(line4p2.X, line4p2.Y, 0), Color.White, new Vector2())
});
renderer.SetScissorRectangle(line2p1.X+1, line1p1.Y, Main.WindowWidth, Main.WindowHeight, false);
lock (controls)
{
foreach (Elements.Control c in controls)
{
c.Draw(renderer);
}
}
renderer.DrawString(fontCurrent, currentState.caption, new Vector2(CaptionPosition.X + 10, CaptionPosition.Y + 10), Color.White,
Renderer.TextAlignment.Left);
if (currentFrame != null && currentFrame.isVisible)
{
renderer.SetScissorRectangle(line3p1.X, line3p1.Y, Main.WindowWidth, Main.WindowHeight, false);
renderer.End();
renderer.BeginUnscaled(SpriteSortMode.Immediate, BlendState.AlphaBlend, null,
null, Graphics.GraphicsEngine.s_ScissorsOn, null, Matrix.CreateTranslation(FrameOffset, 0, 0));
currentFrame.Draw(renderer);
}
renderer.ResetScissorRectangle();
}
示例13: Draw
public override void Draw(Renderer renderer)
{
renderer.End();
renderer.BeginUnscaled(SpriteSortMode.Immediate, null, SamplerState.PointWrap, null, null, null,
Matrix.CreateTranslation(Scene.MainMenu.FrameOffset, 0, 0));
scrollbar.Draw(renderer);
renderer.End();
renderer.SetScissorRectangle(position.X, position.Y + 96, size.X, size.Y - 96, false);
renderer.BeginUnscaled(SpriteSortMode.Immediate, null, null, null, Graphics.GraphicsEngine.s_ScissorsOn, null,
Matrix.CreateTranslation(Scene.MainMenu.FrameOffset, 0, 0));
for (int i = 0; i < elements.Count; i++)
{
elements[i].Draw(renderer);
}
renderer.End();
renderer.ResetScissorRectangle();
renderer.SetScissorRectangle(GUIEngine.s_mainMenu.line3p1.X, GUIEngine.s_mainMenu.line3p1.Y, Main.WindowWidth, Main.WindowHeight, false);
renderer.BeginUnscaled(SpriteSortMode.Immediate, null, null, null, Graphics.GraphicsEngine.s_ScissorsOn, null,
Matrix.CreateTranslation(Scene.MainMenu.FrameOffset, 0, 0));
}
示例14: Draw
public override void Draw(Renderer renderer)
{
base.Draw(renderer);
int dotOutIndex = -1;
bool hasAvalableComponents = false;
for (int i = 0; i < Tiles.Count; i++)
{
if (Tiles[i] is CSFolder && (Tiles[i] as CSFolder).IsOpened)
{
dotOutIndex = i;
break;
}
if (Tiles[i] is CSComponentCopy && (Tiles[i] as CSComponentCopy).Avalable != 0)
hasAvalableComponents = true;
}
//overlay
if (!hasAvalableComponents)
{
renderer.Draw(GraphicsEngine.pixel, new Rectangle((int)position.X, (int)position.Y, SIZE_X, SIZE_Y), Shortcuts.BG_COLOR * 0.5f);
renderer.Draw(GraphicsEngine.pixel, new Rectangle((int)position.X, (int)position.Y, SIZE_X, SIZE_Y), Color.Black * 0.4f);
}
//opened folder
if (IsOpened || animationState > 0)
{
if (animationState < SIZE_X)
{
renderer.SetScissorRectangle(position.X + SIZE_X, 0, SIZE_X, Main.WindowHeight, false);
renderer.End();
renderer.BeginUnscaled(SpriteSortMode.Immediate, BlendState.AlphaBlend, null,
null, Graphics.GraphicsEngine.s_ScissorsOn, null, Matrix.CreateTranslation(animationState - SIZE_X, 0, 0));
}
//bg
RenderHelper.SmartDrawRectangle(ComponentSelector.bg, 8, 42 + (int)position.X, 0, 48, Main.WindowHeight,
Color.White, renderer);
if (dotOutIndex != -1)
{
renderer.End();
renderer.BeginUnscaled(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearWrap, DepthStencilState.None,
RasterizerState.CullNone);
renderer.Draw(ComponentSelector.dotOverlay,
new Rectangle(44 + (int)position.X, 2, 44, Main.WindowHeight - 4),
new Rectangle(44 + (int)position.X, 2, 44, Main.WindowHeight - 4),
Color.White);
}
//items
for (int i = 0; i < Tiles.Count; i++)
{
Tiles[i].Draw(renderer);
if (dotOutIndex != -1 && dotOutIndex != i)
{
renderer.Draw(ComponentSelector.dotOverlay,
new Rectangle((int)Tiles[i].position.X, (int)Tiles[i].position.Y, CSTile.SIZE_X, CSTile.SIZE_Y),
new Rectangle((int)Tiles[i].position.X, (int)Tiles[i].position.Y, CSTile.SIZE_X, CSTile.SIZE_Y),
Color.White);
}
}
if (animationState < SIZE_X)
{
renderer.ResetScissorRectangle();
}
}
}
示例15: Draw
public override void Draw(Renderer renderer)
{
if (article != null)
article.Draw(renderer);
renderer.Draw(folder, Position + new Vector2(26, 26), Color.White);
renderer.Draw(GraphicsEngine.pixel, new Rectangle((int)Position.X - 9, (int)Position.Y + 96, (int)Size.X + 9, 2), Color.White);//top bar
renderer.Draw(GraphicsEngine.pixel, new Rectangle((int)(Position.X + Size.X) - 1, (int)Position.Y + 96, 1, 6), Color.White);//small thing near right sb
renderer.Draw(GraphicsEngine.pixel, new Rectangle((int)Position.X + 278, (int)Position.Y + 96, 2, 6), Color.White);//small thing near left sb
renderer.Draw(GraphicsEngine.pixel, new Rectangle((int)Position.X + 150, (int)Position.Y + (int)Size.Y - 2, 130, 2), Color.White);
renderer.Draw(GraphicsEngine.pixel, new Rectangle((int)Position.X + 278, (int)Position.Y + (int)Size.Y - 7, 2, 6), Color.White);
base.Draw(renderer);
renderer.SetScissorRectangle(Position.X, Position.Y + 98, Size.X, Size.Y - 100, false);
renderer.End();
renderer.BeginUnscaled(SpriteSortMode.Immediate, BlendState.AlphaBlend, null,
null, Graphics.GraphicsEngine.s_ScissorsOn, null,
Matrix.CreateTranslation(MainMenu.FrameOffset + FileListOffset.X, FileListOffset.Y, 0));
for (int i = 0; i < buttons.Count; i++)
{
buttons[i].Draw(renderer);
}
renderer.End();
renderer.ResetScissorRectangle();
renderer.BeginUnscaled(SpriteSortMode.Immediate, BlendState.AlphaBlend, null,
null, RasterizerState.CullNone, null,
Matrix.CreateTranslation(MainMenu.FrameOffset, 0, 0));
}