Convert AnimationWithOffset to world coords.

Animations (via Actor.CenterPosition) now
understand Altitude, so there is potential for
mis-positioned animations if any existing altitude
hacks were missed.
This commit is contained in:
Paul Chote
2013-05-14 21:02:46 +12:00
parent fb17654ea0
commit fe716e76a7
16 changed files with 64 additions and 66 deletions

View File

@@ -32,10 +32,9 @@ namespace OpenRA.Mods.RA.Render
var rs = self.Trait<RenderSimple>();
var spinner = new Animation(rs.GetImage(self));
spinner.PlayRepeating(info.Sequence);
rs.anims.Add("spinner_{0}".F(info.Sequence), new AnimationWithOffset(
spinner,
wr => wr.ScreenPxOffset(rs.LocalToWorld(info.Offset.Rotate(rs.QuantizeOrientation(self, self.Orientation)))),
null ) { ZOffset = 1 } );
rs.anims.Add("spinner_{0}".F(info.Sequence), new AnimationWithOffset(spinner,
() => rs.LocalToWorld(info.Offset.Rotate(rs.QuantizeOrientation(self, self.Orientation))),
null, 1));
}
}
}