Esempio n. 1
0
        public Rectangle ScreenBounds(WorldRenderer wr, WPos pos, WVec offset, float scale)
        {
            var xy = wr.ScreenPxPosition(pos) + wr.ScreenPxOffset(offset);

            var cb = CurrentSequence.Bounds;

            return(Rectangle.FromLTRB(xy.X + (int)(cb.Left * scale),
                                      xy.Y + (int)(cb.Top * scale),
                                      xy.X + (int)(cb.Right * scale),
                                      xy.Y + (int)(cb.Bottom * scale)));
        }
Esempio n. 2
0
        public Rectangle ScreenBounds(WPos pos, WorldRenderer wr, float scale)
        {
            var r      = Model.AggregateBounds;
            var offset = OffsetFunc != null?OffsetFunc() : WVec.Zero;

            var xy = wr.ScreenPxPosition(pos) + wr.ScreenPxOffset(offset);

            return(Rectangle.FromLTRB(
                       xy.X + (int)(r.Left * scale),
                       xy.Y + (int)(r.Top * scale),
                       xy.X + (int)(r.Right * scale),
                       xy.Y + (int)(r.Bottom * scale)
                       ));
        }
Esempio n. 3
0
        Vector3 ScreenPosition(WorldRenderer wr)
        {
            var xy = wr.ScreenPxPosition(pos) + wr.ScreenPxOffset(offset) - (0.5f * scale * sprite.Size.XY).ToInt2();

            return(new Vector3(xy, sprite.Offset.Z + wr.ScreenZPosition(pos, 0) - 0.5f * scale * sprite.Size.Z));
        }