Table of Contents

Class DrawingArea

Namespace
PAC.Drawing
public class DrawingArea : MonoBehaviour
Inheritance
DrawingArea

Properties

file

public File file { get; }

Property Value

File

hasSelection

public bool hasSelection { get; }

Property Value

bool

pixelsPerUnit

public float pixelsPerUnit { get; }

Property Value

float

scrollSpeed

public float scrollSpeed { get; }

Property Value

float

selectionMask

public Texture2D selectionMask { get; }

Property Value

Texture2D

selectionRect

public IntRect selectionRect { get; }

Property Value

IntRect

zoomScrollSpeed

public float zoomScrollSpeed { get; }

Property Value

float

Methods

DeleteSelection()

public void DeleteSelection()

PixelsToWorldPos(IntVector2)

Turns the pixel coordinate in the drawing into a world coordinate (the resulting coord is the centre of the pixel in the world).

public Vector2 PixelsToWorldPos(IntVector2 pixel)

Parameters

pixel IntVector2

Returns

Vector2

PixelsToWorldPos(int, int)

Turns the pixel coordinate in the drawing into a world coordinate (the resulting coord is the centre of the pixel in the world).

public Vector2 PixelsToWorldPos(int x, int y)

Parameters

x int
y int

Returns

Vector2

PixelsToWorldPos(float, float)

Turns the pixel coordinate in the drawing into a world coordinate.

public Vector2 PixelsToWorldPos(float x, float y)

Parameters

x float
y float

Returns

Vector2

PixelsToWorldPos(Vector2)

Turns the pixel coordinate in the drawing into a world coordinate.

public Vector2 PixelsToWorldPos(Vector2 pixel)

Parameters

pixel Vector2

Returns

Vector2

PreviewGradient(IntVector2, IntVector2, Color, Color, GradientMode)

public void PreviewGradient(IntVector2 start, IntVector2 end, Color startColour, Color endColour, GradientMode gradientMode)

Parameters

start IntVector2
end IntVector2
startColour Color
endColour Color
gradientMode GradientMode

UpdateDrawing()

Makes any changes to the file visible on the drawing area.

public void UpdateDrawing()

WorldPosToPixel(Vector2)

Turns the world coord into a pixel coord in the drawing.

public IntVector2 WorldPosToPixel(Vector2 worldPos)

Parameters

worldPos Vector2

Returns

IntVector2

WorldPosToPixels(float, float)

Turns the world coord into a pixel coord in the drawing.

public IntVector2 WorldPosToPixels(float x, float y)

Parameters

x float
y float

Returns

IntVector2