MPImage Basic

Updated on February 28, 2021

MPImageBasic Settings #

DrawShape: Type of the shape to be drawn. Values are Circle, Triangle, Rectangle, NStarPolygon

DrawShape DrawShape { get; set; } = DrawShape.None;

StrokeWidth:Width of the stroke for the drawn shape. 0 is no stroke

float StrokeWidth { get; set; }

OutlineWidth: Width of the outline for the drawn shape. 0 is no outline.

float OutlineWidth { get; set; }

OutlineColor: Color of the Outline. Has no effect if the OutlineWidth is 0.

Color OutlineColor { get; set; }

FallOffDistance: Edge Falloff distance of the drawn Shape.

float FalloffDistance { get; set; } = 0.5f;

ConstrainRotation: Constraints rotation to 0, 90, 270 degrees angle if set to true. But the width and height of the shape is replaced as necessary to avoid clipping. If set to false, any shapes can be rotated in any arbitrary angle but will often result in clipping of the shape.

bool ConstrainRotation { get; set; }

ShapeRotation: Rotation of the Shape.

float ShapeRotation { get; set; }

FlipHorizontal: Flips the Shape Horizontally.

bool FlipHorizontal { get; set; }

FlipVertical: Flips the Shape Vertically.

bool FlipVertical { get; set; }

Type: Type of the image. Only two types are supported. Simple and Filled.
Default and fallback value is Simple

Type type { get; set; } = Type.Simple;

Shapes #

CircleRadius: Radius of the circle. This has no effect if FitToRect is set to true.

float CircleRadius { get; set; }

CircleFitToRect: Fit the Circle to the RectTransform.

bool CircleFitToRect { get; set; }

TriangleCornerRadius: Radius of the three corners. Counter-Clockwise from bottom-left
x => bottom-left, y => bottom-right z => top

Vector3 TriangleCornerRadius { get; set; }

RectangleCornerRadius: Radius of the four corners. Counter-Clockwise from bottom-left
x => bottom-left, y => bottom-right z => top-right, w => top-left

Vector4 RectangleCornerRadius { get; set; }

NStarPolygonSideCount: How many sides should there be in the shape. These sides are equal in size. 3 sides create an equilateral triangle, 6 sides create a hexagon, and so on. 
The value of SideCount should remain between 3 and 10

int NStarPolygonSideCount { get; set; }

NStarPolygonInset: Inset is the value that determines how much should the sides go inside the shape and create a concave star shape. Each side will break in half and their middle point will go towards the center of the shape
Value of inset should remain between 2 and (SideCount – 0.01). 2 is default and means no breaking of the sides.

int NStarPolygonInset { get; set; }

NStarPolygonCornerRadius: Corner Radius of all the corners of the shape.

float NStarPolygonCornerRadius { get; set; }

What are your feelings
Table of contents