예제 #1
0
        public static void SetupBorder(this Sprite[] rect, Frame frame, Texture txt, EditingPoint editing)
        {
            var size = txt.GetLevelDescription(0);

            var w = size.Width * frame.ScaleX / 200.0f;
            var h = size.Height * frame.ScaleY / 200.0f;

            rect.SetupRect(0x222222, w, h);
            rect.SetupPosition(-frame.OriginX - editing.OffsetX + w,
                               -frame.OriginY - editing.OffsetY + h, 0);
        }
예제 #2
0
 public static void SetupFrame(this Sprite sprite, Texture txt, Frame frame, EditingPoint editing)
 {
     //TODO do not use Setup (which only supports Scale but not Size)
     sprite.Setup(txt,
                  OriginX: frame.OriginX + editing.OffsetX + 0.5f,
                  OriginY: frame.OriginY + editing.OffsetY + 0.5f,
                  ScaleX: frame.ScaleX / 100.0f,
                  ScaleY: frame.ScaleY / 100.0f);
     sprite.SetupPosition(0, 0, frame.Rotation / 180.0f * 3.1415926f);
     sprite.SetupColor(frame.Alpha, frame.Red, frame.Green, frame.Blue);
 }