Class DrawingArea
public class DrawingArea : MonoBehaviour
- Inheritance
-
DrawingArea
Properties
file
public File file { get; }
Property Value
hasSelection
public bool hasSelection { get; }
Property Value
pixelsPerUnit
public float pixelsPerUnit { get; }
Property Value
scrollSpeed
public float scrollSpeed { get; }
Property Value
selectionMask
public Texture2D selectionMask { get; }
Property Value
- Texture2D
selectionRect
public IntRect selectionRect { get; }
Property Value
zoomScrollSpeed
public float zoomScrollSpeed { get; }
Property Value
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
Returns
- Vector2
PixelsToWorldPos(float, float)
Turns the pixel coordinate in the drawing into a world coordinate.
public Vector2 PixelsToWorldPos(float x, float y)
Parameters
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
IntVector2end
IntVector2startColour
ColorendColour
ColorgradientMode
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
WorldPosToPixels(float, float)
Turns the world coord into a pixel coord in the drawing.
public IntVector2 WorldPosToPixels(float x, float y)