本文整理汇总了C#中Renderer.DrawSprite方法的典型用法代码示例。如果您正苦于以下问题:C# Renderer.DrawSprite方法的具体用法?C# Renderer.DrawSprite怎么用?C# Renderer.DrawSprite使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Renderer
的用法示例。
在下文中一共展示了Renderer.DrawSprite方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
public override void Render(Renderer renderer)
{
Sprite sp = Sprites[Index];
sp.SetPosition(Position.X, Position.Y);
sp.SetColor(new Color(1, 1, 1, 0.5f));
renderer.DrawSprite(sp, Position.X, Position.Y, OffsetAngle + 90);
}
示例2: Render
public override void Render(Renderer renderer)
{
if (lenth < visible_lenth) //如果小于可视距离则不渲染
return;
float ag = Direction.getcurve(); //获取旋转值
float p = 1 - percent;
float _w = width / 2;
float _h = height / 2;
Body.body.SetWidth(_w * p + _w);
Body.body.SetHeight(_h * p + _h);
Body.body.SetColor(new Color(1, 1, 1, p * 0.3f + 0.4f));
Body.body.SetPosition(Position.X,Position.Y);
renderer.DrawSprite(Body.body,Position.X,Position.Y,ag);
}
示例3: Render
public override void Render(Renderer renderer)
{
base.Render(renderer);
Sprite sp= Sprites[currentIndex];
sp.SetWidth(width);
sp.SetHeight(height);
sp.SetColor(new Color(1, 1, 1, 0.8f));
sp.SetPosition(Position.X,Position.Y);
renderer.DrawSprite(sp);
}
示例4: Render
public void Render(Renderer renderer)
{
if (!Working)
return;
//背景
Sprite sp = BackGround[selectComp];
sp.SetColor(new Color(1, 1, 1, Back_Alpha*0.7f));
sp.SetWidth(Back_WidthMax);
sp.SetHeight(Back_HeightPercent * Back_HeightMax);
sp.SetPosition(Position.X + BackOffsetX, Position.Y);
renderer.DrawSprite(sp);
//文字
sp = MainSprites[selectComp];
sp.SetColor(new Color(1, 1, 1, Text_Alpha));
MainSprites[selectComp].SetPosition(Position.X+Text_OffsetX, Position.Y);
renderer.DrawSprite(sp);
}
示例5: WriteText
/// <summary>
/// 通过Bonus_Font进行书写文字
/// </summary>
/// <param name="renderer">着色器</param>
/// <param name="font">Bonus_Font工具</param>
/// <param name="str">需要书写的字符串</param>
/// <param name="x">字符串中心的坐标x位置</param>
/// <param name="y">字符串中心的坐标y位置</param>
/// <param name="alpha">显示透明度</param>
/// <param name="dis">字体间的间距</param>
public static void WriteText(Renderer renderer,Bonus_Font font, string str,
double x, double y, float alpha=1,float dis = 8)
{
char[] Arr = str.ToCharArray();
int lenth = Arr.Length;
float offset_x = -(lenth / 2) * dis; //坐标偏移量
for (int i = 0; i < lenth; i++)
{
Sprite sp = font.GetChar(Arr[i].ToString());
if (Arr[i] != '/')
{
sp.SetPosition(x + dis * i + offset_x, y);
}
else
sp.SetPosition(x + dis * i + offset_x, y+4);
sp.SetColor(new Color(1, 1, 1, alpha));
renderer.DrawSprite(sp);
}
}