本文介绍: 在a.Trait.RenderAnnotations(a.Actor, this)调用里,就是调用了前面的接口RenderAnnotations函数。DrawDecorations函数先判断这个物品是否被选中,如果包含选中的列表中,那么就可以进行下一步的动作,就是调用函数RenderSelectionBox,也就是SelectionDecorations类的函数,这个函数是重写了基类SelectionDecorationsBase的函数RenderSelectionBox。里调用,主要参数是角色对象。
C#开发的OpenRA游戏之属性SelectionDecorations(12)
前面分析了显示选择框的指示器类SelectionBoxAnnotationRenderable,它的作用就是画一个四个角的方角。
这个类是在属性SelectionDecorations里调用的,如下:
protected override IEnumerable<IRenderable> RenderSelectionBox(Actor self, WorldRenderer wr, Color color)
{
var bounds = interactable.DecorationBounds(self, wr);
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。