本文整理汇总了C#中GuiRenderer.PushTextureFilteringMode方法的典型用法代码示例。如果您正苦于以下问题:C# GuiRenderer.PushTextureFilteringMode方法的具体用法?C# GuiRenderer.PushTextureFilteringMode怎么用?C# GuiRenderer.PushTextureFilteringMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GuiRenderer
的用法示例。
在下文中一共展示了GuiRenderer.PushTextureFilteringMode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderScreenUI
public void RenderScreenUI(GuiRenderer renderer)
{
for (int viewIndex = 0; viewIndex < views.Count; viewIndex++)
{
View view = views[viewIndex];
//draw view on screen
if (view.Opacity > 0)
{
renderer.PushTextureFilteringMode(GuiRenderer.TextureFilteringModes.Point);
renderer.AddQuad(view.Rectangle, new Rect(0, 0, 1, 1), view.Texture,
new ColorValue(1, 1, 1, view.Opacity), true);
renderer.PopTextureFilteringMode();
}
//draw debug info
if (drawDebugInfo)
{
Viewport screenViewport = renderer.ViewportForScreenGuiRenderer;
Vec2 pixelOffset = 1.0f / screenViewport.DimensionsInPixels.Size.ToVec2();
ColorValue color = new ColorValue(1, 1, 0);
renderer.AddRectangle(new Rect(
view.Rectangle.LeftTop + pixelOffset,
view.Rectangle.RightBottom - pixelOffset * 2),
color);
renderer.AddLine(view.Rectangle.LeftTop, view.Rectangle.RightBottom, color);
renderer.AddLine(view.Rectangle.RightTop, view.Rectangle.LeftBottom, color);
if (debugFont == null)
debugFont = FontManager.Instance.LoadFont("Default", .03f);
string sizeString = "";
if (view.Texture != null)
sizeString = string.Format("{0}x{1}", view.Texture.Size.X, view.Texture.Size.Y);
string text = string.Format("View {0}, {1}", viewIndex, sizeString);
Vec2 position = new Vec2(view.Rectangle.Right - pixelOffset.X * 5, view.Rectangle.Top);
AddTextWithShadow(renderer, debugFont, text, position, HorizontalAlign.Right,
VerticalAlign.Top, new ColorValue(1, 1, 1));
}
}
}