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; } }
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."); } }
public SSTextGenerator(SSText[] texts, SSSize canvasSize) { this.texts = texts; this.canvasSize = canvasSize; }
public SSBackgroundGenerator(SSBackground background, SSSize canvasSize) { this.background = background; this.canvasSize = canvasSize; }
public SSDeviceGenerator(SSDevice[] devices, SSSize canvasSize) { this.devices = devices; this.canvasSize = canvasSize; }
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); }
public Device(DeviceModel name, SSSize screenSize, SSPosition screenOffset) { this.name = name; this.screenSize = screenSize; this.screenOffset = screenOffset; }
public SSShapeGenerator(SSShape[] shapes, SSSize canvasSize) { this.shapes = shapes; this.canvasSize = canvasSize; }