本文主要是介绍C#开发的OpenRA游戏之属性SelectionDecorations(11),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
C#开发的OpenRA游戏之属性SelectionDecorations(11)
前面分析选择一个物品的属性,当玩家选择时,就会在物品周边画出四个指示符号。而这四个指示符号,是通过下面的语句:
cr.DrawLine(new float3[] { tl + u, tl, tl + v }, 1, color, true);
不过隐藏在这个函数后面,会有更加复杂的内容。上面语句里可以使用三个坐标来画线,还有线的宽度和颜色,最后的那个参数是连接在一起的意思。
这个函数就会调用类RgbaColorRenderer的函数DrawLine:
public void DrawLine(IEnumerable<float3> points, float width, Color color, bool connectSegments = false, BlendMode blendMode = BlendMode.Alpha)
这篇关于C#开发的OpenRA游戏之属性SelectionDecorations(11)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!