本文整理汇总了C#中Renderer.BeginUnscaled方法的典型用法代码示例。如果您正苦于以下问题:C# Renderer.BeginUnscaled方法的具体用法?C# Renderer.BeginUnscaled怎么用?C# Renderer.BeginUnscaled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Renderer
的用法示例。
在下文中一共展示了Renderer.BeginUnscaled方法的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: 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();
}
示例3: 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);
}
}
示例4: 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();
}
示例5: 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();
}
}
示例6: 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();
}
示例7: 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);
}
示例8: 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));
}
示例9: 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));
}
示例10: Draw
public override void Draw(Renderer renderer)
{
renderer.End();
ClickabilityOverlay.DrawOverlay();
renderer.BeginUnscaled();
}
示例11: DrawToFBO
public void DrawToFBO(Renderer renderer)
{
for (int i = 0; i < tooltips.Count; i++)
{
tooltips[i].Draw(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();
renderer.BeginUnscaled();
}
}
示例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)
{
if (!isVisible || fbo == null)
return;
renderer.End();
renderer.BeginUnscaled(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None,
RasterizerState.CullNone);
renderer.Draw(fbo, new Vector2((int)position.X, (int)position.Y), Color.White * opacity);
renderer.End();
renderer.BeginUnscaled();
base.Draw(renderer);
}
示例14: 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);
}
}
示例15: Draw
public override void Draw(Renderer renderer)
{
if (Main.curState.StartsWith("GAME"))
{
//Grid
#region Grid
MicroWorld.Graphics.GUI.GridDraw.DrawGrid();
#endregion
//AoE-s
#region AoE-s
renderer.End();
renderer.BeginUnscaled(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.AnisotropicClamp, DepthStencilState.None, RasterizerState.CullNone);
LightAOE.Draw(renderer);
MagnetAOE.Draw(renderer);
renderer.End();
renderer.Begin();
#endregion
//Components
#region Components
Components.ComponentsManager.Draw();
Components.ComponentsManager.PostDraw();
#endregion
//SelectedGhost
#region SelectedGhost
if (MicroWorld.Graphics.GUI.GUIEngine.s_componentSelector.SelectedComponent.Text != "Cursor" &&
InputEngine.curMouse.X > GUI.Scene.ComponentSelector.CSTile.SIZE_X && !Logics.GameInputHandler.isLine)// &&
//!MicroWorld.Graphics.GUI.GUIEngine.s_componentSelector.SelectedComponent.IsComponentOfType<Components.Properties.IDragDropPlacable>())
{
int x = (int)((InputEngine.curMouse.X) / Settings.GameScale - Settings.GameOffset.X);
int y = (int)((InputEngine.curMouse.Y) / Settings.GameScale - Settings.GameOffset.Y);
Components.Component.Rotation rot = Logics.GameInputHandler.GhostRotation;
Vector2 size = MicroWorld.Graphics.GUI.GUIEngine.s_componentSelector.SelectedComponentGraphics.GetSizeRotated(rot);
Logics.GridHelper.GridCoords(ref x, ref y);
Logics.PlacableAreasManager.MakePlacable(ref x, ref y, (int)size.X, (int)size.Y);
Logics.GridHelper.GridCoords(ref x, ref y);
Vector2 so = MicroWorld.Graphics.GUI.GUIEngine.s_componentSelector.SelectedComponentGraphics.GetCenter(rot);
int nx = x - (int)so.X, ny = y - (int)so.Y;
bool b = GraphicsEngine.CanDrawGhostComponent(ref nx, ref ny, (int)size.X, (int)size.Y);
Color c = Main.renderer.Overlay;
if (!b)
renderer.Overlay = Color.Red * 0.5f;
if (InputEngine.curMouse.LeftButton == ButtonState.Pressed &&
GUI.GUIEngine.s_componentSelector.SelectedComponent.Avalable == 0)
Main.renderer.Overlay = Main.Ticks % 40 < 20 ? Color.Red : c;
MicroWorld.Graphics.GUI.GUIEngine.s_componentSelector.SelectedComponentGraphics.DrawGhost(
nx,
ny,
Main.renderer, Logics.GameInputHandler.GhostRotation);
Main.renderer.Overlay = c;
#region Dotted Lines
MicroWorld.Graphics.GUI.GUIEngine.s_componentSelector.SelectedComponentGraphics.DrawBorder(
nx, ny, Logics.GameInputHandler.GhostRotation, renderer);
#endregion
}
#endregion
//RemovingComponentsVisuals
#region RemovingComponentsVisuals
MicroWorld.Graphics.Effects.Effects.DrawRemovingVisuals();
#endregion
//MouseOverComponent
#region MouseOverComponent
if (Logics.GameInputHandler.MouseOverComponent != null)
{
Logics.GameInputHandler.MouseOverComponent.Graphics.DrawBorder(renderer);
}
#endregion
//wire
#region Wire
if (Logics.GameInputHandler.isLine)
{
lock (Logics.GameInputHandler.pendingWirePath)
Components.Graphics.WireGraphics.DrawWire(Logics.GameInputHandler.pendingWirePath);
#region Dotted Lines
if (Logics.GameInputHandler.pendingWirePath != null && Logics.GameInputHandler.pendingWirePath.Count > 0)
{
//optimization
List<Vector2> l = new List<Vector2>();
Vector2 v1 = new Vector2(), v2 = new Vector2();
lock (Logics.GameInputHandler.pendingWirePath)
{
l.Add(new Vector2(Logics.GameInputHandler.pendingWirePath[0].X, Logics.GameInputHandler.pendingWirePath[0].Y));
for (int i = 1; i < Logics.GameInputHandler.pendingWirePath.Count - 1; i++)
{
v1 = new Vector2(Logics.GameInputHandler.pendingWirePath[i].X - Logics.GameInputHandler.pendingWirePath[i - 1].X,
Logics.GameInputHandler.pendingWirePath[i].Y - Logics.GameInputHandler.pendingWirePath[i - 1].Y);
v2 = new Vector2(Logics.GameInputHandler.pendingWirePath[i + 1].X - Logics.GameInputHandler.pendingWirePath[i].X,
Logics.GameInputHandler.pendingWirePath[i + 1].Y - Logics.GameInputHandler.pendingWirePath[i].Y);
if (((v1.X != 0) != (v2.X != 0)) ||
(v1.Y != 0) != (v2.Y != 0))
//.........这里部分代码省略.........