예제 #1
0
        IEnumerable <IRenderable> IDecoration.RenderDecoration(Actor self, WorldRenderer wr, ISelectionDecorations container)
        {
            if (IsTraitDisabled || self.IsDead || !self.IsInWorld || !ShouldRender(self))
            {
                return(Enumerable.Empty <IRenderable>());
            }

            var screenPos = container.GetDecorationOrigin(self, wr, Info.Position, Info.Margin) + conditionalOffset;

            return(RenderDecoration(self, wr, screenPos));
        }
예제 #2
0
        IEnumerable <IRenderable> IDecoration.RenderDecoration(Actor self, WorldRenderer wr, ISelectionDecorations container)
        {
            var group = self.World.Selection.GetControlGroupForActor(self);

            if (group == null)
            {
                return(Enumerable.Empty <IRenderable>());
            }

            var text      = label.Update(group.Value);
            var screenPos = container.GetDecorationOrigin(self, wr, info.Position, info.Margin);

            return(new IRenderable[]
            {
                new UITextRenderable(font, self.CenterPosition, screenPos, 0, color, text)
            });
        }
        IEnumerable <IRenderable> IDecoration.RenderDecoration(Actor self, WorldRenderer wr, ISelectionDecorations container)
        {
            var group = self.World.ControlGroups.GetControlGroupForActor(self);

            if (group == null)
            {
                return(Enumerable.Empty <IRenderable>());
            }

            anim.PlayFetchIndex(Info.GroupSequence, () => (int)group);

            var screenPos = container.GetDecorationOrigin(self, wr, Info.Position, Info.Margin) - (0.5f * anim.Image.Size.XY).ToInt2();
            var palette   = wr.Palette(Info.Palette);

            return(new IRenderable[]
            {
                new UISpriteRenderable(anim.Image, self.CenterPosition, screenPos, 0, palette)
            });
        }