本文整理汇总了C#中RenderingContext.AddTexture方法的典型用法代码示例。如果您正苦于以下问题:C# RenderingContext.AddTexture方法的具体用法?C# RenderingContext.AddTexture怎么用?C# RenderingContext.AddTexture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RenderingContext
的用法示例。
在下文中一共展示了RenderingContext.AddTexture方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawEntityHealthbar
private void DrawEntityHealthbar(Color color, Color outline, Rect bg, float hpWidth, float esWidth, RenderingContext rc)
{
if (outline.ToArgb() != 0)
{
Rect rect = new Rect(bg.X - 2, bg.Y - 2, bg.W + 4, bg.H + 4);
rc.AddBox(rect, outline);
}
rc.AddTexture(Settings.GetBool("Healthbars.ShowIncrements") ? "healthbar_increment.png" : "healthbar.png", bg, color);
if ((int)hpWidth < bg.W)
{
Rect rect2 = new Rect(bg.X + (int)hpWidth, bg.Y, bg.W - (int)hpWidth, bg.H);
rc.AddTexture("healthbar_bg.png", rect2, color);
}
if (Settings.GetBool("Healthbars.ShowES"))
{
bg.W = (int)esWidth;
rc.AddTexture("esbar.png", bg, Color.White);
}
}
示例2: Render
public override void Render(RenderingContext rc)
{
if (!this.isVisible)
{
return;
}
Color color = this.isEnabled ? Color.Gray : Color.Crimson;
rc.AddTextWithHeight(new Vec2(base.Bounds.X + base.Bounds.W / 2, base.Bounds.Y + base.Bounds.H / 2), this.text, Color.White, 12, DrawTextFormat.VerticalCenter | DrawTextFormat.Center);
rc.AddBox(base.Bounds, Color.Black);
rc.AddBox(new Rect(base.Bounds.X + 1, base.Bounds.Y + 1, base.Bounds.W - 2, base.Bounds.H - 2), color);
if (this.children.Count > 0)
{
int num = (int)((float)(base.Bounds.W - 2) * 0.05f);
int num2 = (base.Bounds.H - 2) / 2;
rc.AddTexture("menu_submenu.png", new Rect(base.Bounds.X + base.Bounds.W - 1 - num, base.Bounds.Y + 1 + num2 - num2 / 2, num, num2));
}
foreach (MenuItem current in this.children)
{
current.Render(rc);
}
}