示例#1
0
 public void setSize(SSSize canvasSize)
 {
     if (fillX == true)
     {
         size.width   = canvasSize.width;
         alignX.style = AlignKeys.Center;
     }
     if (fillY == true)
     {
         size.height  = canvasSize.height;
         alignY.style = AlignKeys.Center;
     }
 }
示例#2
0
 private void setCanvasSize()
 {
     if (canvasSize.width == 0 && canvasSize.height == 0)
     {
         if (canvasModel.HasValue)
         {
             foreach (Device dev in Devices.all)
             {
                 if (dev.name == canvasModel)
                 {
                     canvasSize = dev.screenSize;
                     return;
                 }
             }
         }
         Print.Warning("Canvas size and canvasModels are empty, canvas size will be zero.");
     }
 }
示例#3
0
 public SSTextGenerator(SSText[] texts, SSSize canvasSize)
 {
     this.texts      = texts;
     this.canvasSize = canvasSize;
 }
示例#4
0
 public SSBackgroundGenerator(SSBackground background, SSSize canvasSize)
 {
     this.background = background;
     this.canvasSize = canvasSize;
 }
示例#5
0
 public SSDeviceGenerator(SSDevice[] devices, SSSize canvasSize)
 {
     this.devices    = devices;
     this.canvasSize = canvasSize;
 }
示例#6
0
        public static SSPosition getPosition(SSAlign alignX, SSAlign alignY, float width, float height, SSSize canvasSize)
        {
            var calculatedPos = new SSPosition(0, 0);

            if (alignX != null)
            {
                switch (alignX.style)
                {
                case AlignKeys.Center:
                    calculatedPos.x = ((canvasSize.width - width) / 2) + alignX.value;
                    break;

                case AlignKeys.Left:
                    calculatedPos.x = alignX.value;
                    break;

                case AlignKeys.Right:
                    calculatedPos.x = canvasSize.width - width - alignX.value;
                    break;
                }
            }
            if (alignY != null)
            {
                switch (alignY.style)
                {
                case AlignKeys.Center:
                    calculatedPos.y = (canvasSize.height - height) / 2 + alignY.value;
                    break;

                case AlignKeys.Top:
                    calculatedPos.y = alignY.value;
                    break;

                case AlignKeys.Bottom:
                    calculatedPos.y = canvasSize.height - height - alignY.value;
                    break;
                }
            }
            return(calculatedPos);
        }
示例#7
0
 public Device(DeviceModel name, SSSize screenSize, SSPosition screenOffset)
 {
     this.name         = name;
     this.screenSize   = screenSize;
     this.screenOffset = screenOffset;
 }
示例#8
0
 public SSShapeGenerator(SSShape[] shapes, SSSize canvasSize)
 {
     this.shapes     = shapes;
     this.canvasSize = canvasSize;
 }