My Project
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | Static Public Attributes | Properties | List of all members
GraphicDNA.Drawing2D Class Reference

Public Types

enum  eCoordsType { PixelCoordinates , HomogeneousClipSpace01 }
 

Static Public Member Functions

static void ClearFrameBuffer (Color pClearColor)
 Clears the frame buffer window to the specified color.
 
static void SetParentBounds (Rect pRect)
 [DEPRECATED]: This method will be removed in the future. Please use SetViewport instead Sets the coordinate system for drawing operations so the (0,0) is the top-left corner of the group. Use this method from outside OnGui code parts, like OnPostRender methods. If pClip is enabled, all controls are clipped to the group. Groups CANNOT be nested

 
static void SetViewport (Vector2 pCoords, int pScreenWidth, int pScreenHeight, bool pFlipYCoords=true)
 Sets the origin of the coordinate system for drawing operations so the (0,0)
 
static void ClearParentBounds ()
 [DEPRECATED]: This method will be removed in the future. Please use ClearOriginCoords instead Resets the origin of the parent coordinates to be 0,0
 
static void ClearViewport ()
 Resets the origin of the parent coordinates to be 0,0.
 
static Rect GetWorldRect (RectTransform pTransform)
 Returns the world position and size of a UI element (provided its RectTransform) The returned position corresponds to the Top-Left corner of the element.
 
static void DrawPoint (Vector2 pPoint, Color color)
 Draws a point.
 
static void DrawPoint (Vector2 pPoint, Color color, float pSize)
 Draws a point.
 
static void DrawTexture (Rect pRect, Color color, Texture2D pTexture)
 Draws a texture.
 
static void DrawLine (Vector2 pointA, Vector2 pointB)
 Draws a line between two points. GUI.ContentColor is assumed to draw the line.
 
static void DrawLine (Vector2 pointA, Vector2 pointB, Color color)
 Draws a line between two points.
 
static void DrawLine (Vector2 pointA, Vector2 pointB, float width)
 Draws a line between two points. GUI.ContentColor is assumed to draw the line.
 
static void DrawLine (Vector2 pointA, Vector2 pointB, Color color, float width)
 Draws a line between two points.
 
static void DrawLine (Vector2 p1, Vector2 p2, Color color, float lineWidth, Texture2D pOverrideTexture=null, Vector2? pTilingMultiplier=null)
 Draws a line between two points, using a customized base texture to fill the segment.
 
static void DrawLines (Vector2[] pPointPairs, Color pColor)
 Draws lines with thickness == 1, using GUI 2D points.
 
static void DrawLines (Vector3[] vertexBuffer, Color pColor)
 Draws lines with thickness == 1, using OpenGL Vector3 points in homogeneous coords. Please use the BuildGLVertexBuffer method to convert from GUI coordinates to OpenGL homogeneous coordinates.
 
static void DrawLines (Vector2[] pPointPairs, Color pColor, float lineWidth, Texture2D pOverrideTexture=null, Vector2? pTilingMultiplier=null, bool pFixLineCorners=true)
 Draws lines, using OpenGL Vector3 points in homogeneous coords. Please use the BuildGLVertexBuffer method to convert from GUI coordinates to OpenGL homogeneous coordinates.
 
static void DrawDashedLine (Vector2 pointA, Vector2 pointB)
 Draws a dashed line between two points. GUI.ContentColor is assumed to draw the line.
 
static void DrawDashedLine (Vector2 pointA, Vector2 pointB, Color color)
 Draws a dashed line between two points.
 
static void DrawDashedLine (Vector2 pointA, Vector2 pointB, float width)
 Draws a dashed line between two points. GUI.ContentColor is assumed to draw the line.
 
static void DrawDashedLine (Vector2 p1, Vector2 p2, Color color, float lineWidth, float pDashMultiplier=3f)
 Draws a dashed line between two points.
 
static void DrawArrow (Vector2 p1, Vector2 p2, Color color, float lineWidth, float pTipWidth, float pTipLength)
 Draws an arrow.
 
static void DrawDashedArrow (Vector2 p1, Vector2 p2, Color color, float lineWidth, float pTipWidth, float pTipLength, float pDashMultiplier=3)
 Draws an arrow.
 
static void DrawArc (Vector2 center, float radius, int sides, float pStartAngleDeg, float pDegrees)
 Draws a Arc. GUI.ContentColor is assumed to draw the circle.
 
static void DrawArc (Vector2 center, float radius, int sides, float pStartAngleDeg, float pDegrees, Color color)
 Draws a Arc.
 
static void DrawArc (Vector2 center, float radius, int sides, float pStartAngleDeg, float pDegrees, Color color, float lineWidth)
 Draws a Arc.
 
static void DrawArc (Vector2 center, float radius, int sides, float pStartAngleDeg, float pDegrees, Color color, float lineWidth, Texture2D pLineTexture)
 Draws a Arc.
 
static void DrawDashedArc (Vector2 center, float radius, int sides, float pStartAngleDeg, float pDegrees, Color color, float lineWidth, float pDashMultiplier=3)
 Draws a dashed Arc.
 
static void DrawCircle (Vector2 center, float radius, int sides)
 Draws a circle. GUI.ContentColor is assumed to draw the circle.
 
static void DrawCircle (Vector2 center, float radius, int sides, Color color)
 Draws a circle.
 
static void DrawCircle (Vector2 center, float radius, int sides, Color color, float lineWidth)
 Draws a circle.
 
static void DrawCircle (Vector2 center, float radius, int sides, Color color, float lineWidth, Texture2D pLineTexture)
 Draws a circle.
 
static void DrawDashedCircle (Vector2 center, float radius, int sides, Color color, float lineWidth, float pDashMultiplier=3f)
 Draws a circle.
 
static void FillCircle (Vector2 center, float radius)
 Fills a circle, using GUI.Content color.
 
static void FillCircle (Vector2 center, float radius, Color color)
 Fills a circle.
 
static void FillCircle (Vector2 center, float radius, Color color, Texture2D pCircleTexture)
 Fills a circle.
 
static void DrawQuad (Vector2 pCenter, float pWidth, float pHeight, Color pColor, float pLineWidth, float? pOrientationDeg=null, Vector2? pRotationCenter01=null, Texture2D pOverrideTexture=null)
 Fills a quad with an arbitrary orientation.
 
static void DrawDashedQuad (Vector2 pCenter, float pWidth, float pHeight, Color pColor, float pLineWidth, float? pOrientationDeg=null, Vector2? pRotationCenter01=null, float pDashMultiplier=3)
 Fills a quad with an arbitrary orientation.
 
static void FillQuad (Vector2 pCenter, float pWidth, float pHeight, Color pColor, float? pRotationDeg=null, Vector2? pRotationCenter01=null, Texture2D pOverrideTexture=null, Vector2? pTilingMultiplier=null)
 Fills a quad with an arbitrary orientation.
 
static void FillQuads (Vector2[] pVertices, Color color)
 Fills quads defined by their list of vertices. Each quad is defined by its 4 vertices in the following order: BL, TL, TR, BR.
 
static void FillQuads (Vector2[] pVertices, Color color, Texture2D pOverrideTexture, Vector2? pTilingMultiplier=null)
 Fills quads defined by their list of vertices. Each quad is defined by its 4 vertices in the following order: BL, TL, TR, BR.
 
static void FillQuads (Vector2[] pVertices, Vector2[] pTexCoords, Color color, Texture2D pOverrideTexture)
 Fills quads defined by their list of vertices Each quad is defined by its 4 vertices in the following order: BL, TL, TR, BR.
 
static void FillQuadFullScreen (Color color)
 WIP.
 
static void FillQuadFullScreen (Color color, Texture2D pOverrideTexture=null, Vector2? pTilingMultiplier=null)
 WIP.
 
static void DrawRect (Rect pRect)
 Draws a rectangle (draws the four sides of it). GUI.ContentColor is assumed.
 
static void DrawRect (Rect pRect, Color color)
 Draws a rectangle (draws the four sides of it)
 
static void DrawRect (Rect pRect, Color color, float lineWidth)
 Draws a rectangle (draws the four sides of it)
 
static void DrawRect (Rect pRect, Color color, float lineWidth, Texture2D pTexture)
 Draws a rectangle (draws the four sides of it)
 
static void DrawDashedRect (Rect pRect, Color color, float lineWidth, float pDashMultiplier=3)
 Draws a rectangle (draws the four sides of it)
 
static void DrawRects (IList< Rect > pRects, Color pColor, bool pClearFrameBufferColor=false)
 Draws Rects using OpenGL, ideal for performance critical situations. Please note: Rects drawn using OpenGL are not affected by clipping.
 
static void FillRect (Rect pRect)
 Fills a rectange. GUI.ContentColor is assumed.
 
static void FillRect (Rect pRect, Color color)
 Fills a rectange.
 
static void FillRect (Rect pRectangle, Color pColor, Texture2D pTexture=null, Vector2? pTilingMultiplier=null)
 Fills a rectange.
 
static void DrawTriangle (Vector2 pA, Vector2 pB, Vector2 pC, Color color, float lineWidth)
 Draws a Triangle, defined by 3 points.
 
static void DrawTriangle (Vector2 pA, Vector2 pB, Vector2 pC, Color color, float lineWidth, Texture2D pLineTexture)
 Draws a Triangle, defined by 3 points.
 
static void DrawDashedTriangle (Vector2 pA, Vector2 pB, Vector2 pC, Color color, float lineWidth, float pDashMultiplier=3)
 Draws a Triangle, defined by 3 points.
 
static void FillTriangle (Vector2 pA, Vector2 pB, Vector2 pC, Color color, Texture2D pOverrideTexture=null, Vector2? pTilingMultiplier=null)
 
static void FillTriangleStrip (Vector2[] pTrianglePoints, Color color, Vector2[] pUVCoords=null, Texture2D pOverrideTexture=null, Vector2? pTilingMultiplier=null)
 
static void DrawPolygon (Vector2[] pVertices)
 Draws a closed polygon (draws a line between each pair of vertices, in order, and one closing line between the last and the first) Assumes GUI.ContentColor.
 
static void DrawPolygon (Vector2[] pVertices, Color color)
 Draws a closed polygon (draws a line between each pair of vertices, in order, and one closing line between the last and the first)
 
static void DrawPolygon (Vector2[] pVertices, Color color, float lineWidth)
 Draws a closed polygon (draws a line between each pair of vertices, in order, and one closing line between the last and the first)
 
static void DrawPolygon (Vector2[] pVertices, Color color, float lineWidth, Texture2D pLineTexture)
 Draws a closed polygon (draws a line between each pair of vertices, in order, and one closing line between the last and the first)
 
static void DrawPolygon (Vector2[] pVertices, Color color, float lineWidth, Texture2D pLineTexture, bool pLeaveOpen, bool pFixLineCorners=true)
 Draws a closed or open polygon (draws a line between each pair of vertices, in order, and if pLeaveOpen is false, draws a closing line between the last and the first)
 
static void FillPolygonConvex (Vector2[] pVertices, Color color)
 Fills a polygon, with the requisite that polygon is convex. If it's a concave polygon, this method won't work.
 
static void FillPolygonTriStrip (Vector2[] pVertices, Color color, Vector2[] pUVCoords, Texture2D pTexture)
 Fills a polygon with triangles.
 
static void FillPolygonTriStrip (Vector2[] pVertices, Color color)
 Fills a polygon with triangles.
 
static void DrawDashedPolygon (Vector2[] pVertices, Color color, float lineWidth, bool pLeaveOpen, float pDashMultiplier=3f)
 Draws a closed or open, dashed polygon (draws a dashed line between each pair of vertices, in order, and if pLeaveOpen is false, draws a closing line between the last and the first)
 
static void DrawPentagon (Vector2 center, float radius, Color color, float lineWidth)
 Draws a pentagon.
 
static void DrawPentagon (Vector2 center, float radius, Color color, float lineWidth, Texture2D pLineTexture)
 Draws a pentagon.
 
static void DrawDashedPentagon (Vector2 center, float radius, Color color, float lineWidth, float pDashMultiplier=3)
 Draws a dashed pentagon.
 
static void DrawHexagon (Vector2 center, float radius, Color color, float lineWidth)
 Draws a Hexagon.
 
static void DrawHexagon (Vector2 center, float radius, Color color, float lineWidth, Texture2D pLineTexture)
 Draws a Hexagon.
 
static void DrawDashedHexagon (Vector2 center, float radius, Color color, float lineWidth, float pDashMultiplier=3)
 Draws a dashed Hexagon.
 
static void DrawOctogon (Vector2 center, float radius, Color color, float lineWidth)
 Draws a Octogon.
 
static void DrawOctogon (Vector2 center, float radius, Color color, float lineWidth, Texture2D pLineTexture)
 Draws a Octogon.
 
static void DrawDashedOctogon (Vector2 center, float radius, Color color, float lineWidth, float pDashMultiplier=3)
 Draws a dashed Octogon.
 
static void DrawText (string pText, Vector2 pPos, int pFontSize, Color pColor, BitmapFont pFont, bool pRightAlign=false)
 Draws text using BitmapFonts (compatible with OnGUI and OnPostRender methods)
 
static void DrawText (string pText, float pX, float pY, int pFontSize, Color pColor, BitmapFont pFont, bool pRightAlign=false)
 Draws text using BitmapFonts (compatible with OnGUI and OnPostRender methods)
 
static void DrawText (string pText, float pX, float pY, float pRotationDegs, float pTextWorldSizePixels, Color pColor, BitmapFont pFont, bool pRightAlign=false)
 Draws text using BitmapFonts (compatible with OnGUI and OnPostRender methods)
 
static Vector2 MeasureText (string pText, float pTextWorldSizePixels, BitmapFont pFont)
 Measures the world size of a string, when rendered with the provided font and fontsize.
 
static void DrawGUIText (string pText, Vector2 pPos, int pFontSize, Color pColor)
 Draws text using GUI Label capabilities and TextStyles (compatible with OnGui methods only)
 
static void DrawGUIText (string pText, float pX, float pY, int pFontSize, Color pColor)
 Draws text using GUI Label capabilities and TextStyles (compatible with OnGui methods only)
 
static void DrawGUIText (string pText, float pX, float pY, GUIStyle pTextStyle)
 Draws text using GUI Label capabilities and TextStyles (compatible with OnGui methods only)
 
static Vector2 WorldToCanvas (Vector3 position, RectTransform canvas)
 

Static Public Attributes

static bool FlipUpsideDown = true
 
static ? float mScreenWidth = null
 
static ? float mScreenHeight = null
 

Properties

static float ScreenWidth [get, set]
 Screen Width, in pixels. If no custom value is set, unity's Screen.Width will be used as default.
 
static float ScreenHeight [get, set]
 Screen Height, in pixels. If no custom value is set, unity's Screen.Height will be used as default.
 
static Material MaterialColorOnly [get]
 Returns the default material to fill shapes.
 
static Material MaterialColorAndTexture [get]
 Returns the default material to fill shapes.
 
static Texture2D DefaultDashedLineTexture [get]
 Default pixel texture used for filling dashed shapes.
 
static Texture2D DefaultCircleTexture [get]
 Default circle texture used for filling round shapes.
 
static Texture2D DefaultTriangleTexture [get]
 Default Triangle texture used for filling triangle shapes.
 
static GUIStyle DefaultTextStyle [get]
 Default text style to render text.
 

Member Function Documentation

◆ ClearFrameBuffer()

static void GraphicDNA.Drawing2D.ClearFrameBuffer ( Color  pClearColor)
inlinestatic

Clears the frame buffer window to the specified color.

Parameters
pClearColor

◆ DrawArc() [1/4]

static void GraphicDNA.Drawing2D.DrawArc ( Vector2  center,
float  radius,
int  sides,
float  pStartAngleDeg,
float  pDegrees 
)
inlinestatic

Draws a Arc. GUI.ContentColor is assumed to draw the circle.

Parameters
centerCenter of the circle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
radiusRadius of the circle, in Pixels
sidesNumber of sides (more sides, more detail and less performance)
pStartAngleDegDegrees where arc starts (being 0º == 15h in a clock and 270º == 12h)
pDegreesNumber of degrees to rotate, starting from pStartAngleDeg

◆ DrawArc() [2/4]

static void GraphicDNA.Drawing2D.DrawArc ( Vector2  center,
float  radius,
int  sides,
float  pStartAngleDeg,
float  pDegrees,
Color  color 
)
inlinestatic

Draws a Arc.

Parameters
centerCenter of the circle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
radiusRadius of the circle, in Pixels
sidesNumber of sides (more sides, more detail and less performance)
pStartAngleDegDegrees where arc starts (being 0º == 15h in a clock and 270º == 12h)
pDegreesNumber of degrees to rotate, starting from pStartAngleDeg
colorColor of the circle

◆ DrawArc() [3/4]

static void GraphicDNA.Drawing2D.DrawArc ( Vector2  center,
float  radius,
int  sides,
float  pStartAngleDeg,
float  pDegrees,
Color  color,
float  lineWidth 
)
inlinestatic

Draws a Arc.

Parameters
centerCenter of the circle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
radiusRadius of the circle, in Pixels
sidesNumber of sides (more sides, more detail and less performance)
pStartAngleDegDegrees where to start the arc, being 0º = 15h on a clock, 90º = 18h, 180º = 21h, etc
pDegreesNumber of degrees to rotate, starting from pStartAngleDeg
colorColor of the circle
lineWidthLine thickness, in pixels

◆ DrawArc() [4/4]

static void GraphicDNA.Drawing2D.DrawArc ( Vector2  center,
float  radius,
int  sides,
float  pStartAngleDeg,
float  pDegrees,
Color  color,
float  lineWidth,
Texture2D  pLineTexture 
)
inlinestatic

Draws a Arc.

Parameters
centerCenter of the circle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
radiusRadius of the circle, in Pixels
sidesNumber of sides (more sides, more detail and less performance)
pStartAngleDegDegrees where to start the arc, being 0º = 15h on a clock, 90º = 18h, 180º = 21h, etc
pDegreesNumber of degrees to rotate, starting from pStartAngleDeg
colorColor of the circle
lineWidthLine thickness, in pixels
pLineTextureCustom base texture to fill the segments (null to use default fill)


◆ DrawArrow()

static void GraphicDNA.Drawing2D.DrawArrow ( Vector2  p1,
Vector2  p2,
Color  color,
float  lineWidth,
float  pTipWidth,
float  pTipLength 
)
inlinestatic

Draws an arrow.

Parameters
p1First point of the arrow (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
p2Second point of the arrow (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
colorColor of the arrow
lineWidthLine thickness, in pixels
pTipWidthWidth of the tip, in pixels
pTipLengthLength of the tip, in pixels

◆ DrawCircle() [1/4]

static void GraphicDNA.Drawing2D.DrawCircle ( Vector2  center,
float  radius,
int  sides 
)
inlinestatic

Draws a circle. GUI.ContentColor is assumed to draw the circle.

Parameters
centerCenter of the circle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
radiusRadius of the circle, in Pixels
sidesNumber of sides (more sides, more detail and less performance)

◆ DrawCircle() [2/4]

static void GraphicDNA.Drawing2D.DrawCircle ( Vector2  center,
float  radius,
int  sides,
Color  color 
)
inlinestatic

Draws a circle.

Parameters
centerCenter of the circle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
radiusRadius of the circle, in Pixels
sidesNumber of sides (more sides, more detail and less performance)
colorColor of the circle

◆ DrawCircle() [3/4]

static void GraphicDNA.Drawing2D.DrawCircle ( Vector2  center,
float  radius,
int  sides,
Color  color,
float  lineWidth 
)
inlinestatic

Draws a circle.

Parameters
centerCenter of the circle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
radiusRadius of the circle, in Pixels
sidesNumber of sides (more sides, more detail and less performance)
colorColor of the circle
lineWidthLine thickness, in pixels

◆ DrawCircle() [4/4]

static void GraphicDNA.Drawing2D.DrawCircle ( Vector2  center,
float  radius,
int  sides,
Color  color,
float  lineWidth,
Texture2D  pLineTexture 
)
inlinestatic

Draws a circle.

Parameters
centerCenter of the circle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
radiusRadius of the circle, in Pixels
sidesNumber of sides (more sides, more detail and less performance)
colorColor of the circle
lineWidthLine thickness, in pixels
pLineTextureCustom base texture to fill the segments (null to use default fill)


◆ DrawDashedArc()

static void GraphicDNA.Drawing2D.DrawDashedArc ( Vector2  center,
float  radius,
int  sides,
float  pStartAngleDeg,
float  pDegrees,
Color  color,
float  lineWidth,
float  pDashMultiplier = 3 
)
inlinestatic

Draws a dashed Arc.

Parameters
centerCenter of the circle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
radiusRadius of the circle, in Pixels
sidesNumber of sides (more sides, more detail and less performance)
pStartAngleDegDegrees where to start the arc, being 0º = 15h on a clock, 90º = 18h, 180º = 21h, etc
pDegreesNumber of degrees to rotate, starting from pStartAngleDeg
colorColor of the circle
lineWidthLine thickness, in pixels
pDashMultiplierDash frequency multiplier (min = 0.1, max = 10, default = 3)

◆ DrawDashedArrow()

static void GraphicDNA.Drawing2D.DrawDashedArrow ( Vector2  p1,
Vector2  p2,
Color  color,
float  lineWidth,
float  pTipWidth,
float  pTipLength,
float  pDashMultiplier = 3 
)
inlinestatic

Draws an arrow.

Parameters
p1First point of the arrow (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
p2Second point of the arrow (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
colorColor of the arrow
lineWidthLine thickness, in pixels
pTipWidthWidth of the tip, in pixels
pTipLengthLength of the tip, in pixels
pDashMultiplierDash frequency multiplier (min = 0.1, max = 10, default = 3)

◆ DrawDashedCircle()

static void GraphicDNA.Drawing2D.DrawDashedCircle ( Vector2  center,
float  radius,
int  sides,
Color  color,
float  lineWidth,
float  pDashMultiplier = 3f 
)
inlinestatic

Draws a circle.

Parameters
centerCenter of the circle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
radiusRadius of the circle, in Pixels
sidesNumber of sides (more sides, more detail and less performance)
colorColor of the circle
lineWidthLine thickness, in pixels


Parameters
pDashMultiplierDash frequency multiplier (min = 0.1, max = 10, default = 3)

◆ DrawDashedHexagon()

static void GraphicDNA.Drawing2D.DrawDashedHexagon ( Vector2  center,
float  radius,
Color  color,
float  lineWidth,
float  pDashMultiplier = 3 
)
inlinestatic

Draws a dashed Hexagon.

Parameters
centerCenter of the Hexagon (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
radiusRadius, in pixels
colorColor of the pentagon
lineWidthLine thickness, in pixels
pDashMultiplierDash frequency multiplier (min = 0.1, max = 10, default = 3)

◆ DrawDashedLine() [1/4]

static void GraphicDNA.Drawing2D.DrawDashedLine ( Vector2  p1,
Vector2  p2,
Color  color,
float  lineWidth,
float  pDashMultiplier = 3f 
)
inlinestatic

Draws a dashed line between two points.

Parameters
p1First point of the line (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
p2Second point of the line (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
colorColor of the line
lineWidthLine thickness, in pixels
pDashMultiplierDash frequency multiplier (min = 0.1, max = 10, default = 3)

◆ DrawDashedLine() [2/4]

static void GraphicDNA.Drawing2D.DrawDashedLine ( Vector2  pointA,
Vector2  pointB 
)
inlinestatic

Draws a dashed line between two points. GUI.ContentColor is assumed to draw the line.

Parameters
pointAFirst point of the line (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pointBSecond point of the line (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)

◆ DrawDashedLine() [3/4]

static void GraphicDNA.Drawing2D.DrawDashedLine ( Vector2  pointA,
Vector2  pointB,
Color  color 
)
inlinestatic

Draws a dashed line between two points.

Parameters
pointAFirst point of the line (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pointBSecond point of the line (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
colorColor of the line

◆ DrawDashedLine() [4/4]

static void GraphicDNA.Drawing2D.DrawDashedLine ( Vector2  pointA,
Vector2  pointB,
float  width 
)
inlinestatic

Draws a dashed line between two points. GUI.ContentColor is assumed to draw the line.

Parameters
pointAFirst point of the line (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pointBSecond point of the line (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
widthLine thickness, in pixels

◆ DrawDashedOctogon()

static void GraphicDNA.Drawing2D.DrawDashedOctogon ( Vector2  center,
float  radius,
Color  color,
float  lineWidth,
float  pDashMultiplier = 3 
)
inlinestatic

Draws a dashed Octogon.

Parameters
centerCenter of the Octogon (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
radiusRadius, in pixels
colorColor of the pentagon
lineWidthLine thickness, in pixels
pDashMultiplierDash frequency multiplier (min = 0.1, max = 10, default = 3)

◆ DrawDashedPentagon()

static void GraphicDNA.Drawing2D.DrawDashedPentagon ( Vector2  center,
float  radius,
Color  color,
float  lineWidth,
float  pDashMultiplier = 3 
)
inlinestatic

Draws a dashed pentagon.

Parameters
centerCenter of the pentagon (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
radiusRadius, in pixels
colorColor of the pentagon
lineWidthLine thickness, in pixels
pDashMultiplierDash frequency multiplier (min = 0.1, max = 10, default = 3)

◆ DrawDashedPolygon()

static void GraphicDNA.Drawing2D.DrawDashedPolygon ( Vector2[]  pVertices,
Color  color,
float  lineWidth,
bool  pLeaveOpen,
float  pDashMultiplier = 3f 
)
inlinestatic

Draws a closed or open, dashed polygon (draws a dashed line between each pair of vertices, in order, and if pLeaveOpen is false, draws a closing line between the last and the first)

Parameters
pVerticesArray of vertices of the polygon (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
colorColor of the polygon
lineWidthLine thickness, in pixels
pLineTextureCustom texture to use as base fill (null to use default fill)
pLeaveOpenTrue to leave the polygon open. False to close it with a final line between the last and first vertices
pDashMultiplierDash frequency multiplier (min = 0.1, max = 10, default = 3)

◆ DrawDashedQuad()

static void GraphicDNA.Drawing2D.DrawDashedQuad ( Vector2  pCenter,
float  pWidth,
float  pHeight,
Color  pColor,
float  pLineWidth,
float?  pOrientationDeg = null,
Vector2?  pRotationCenter01 = null,
float  pDashMultiplier = 3 
)
inlinestatic

Fills a quad with an arbitrary orientation.

Parameters
pCenterCenter of the quad (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pWidthWidth of the quad, in pixels
pHeightHeight of the quad, in pixels
pColorColor of the quad
pLineWidthLine thickness, in pixels
pOrientationOrientation of the quad, in degrees, or null to use default
pRotationCenter01Rotation center, or pivot point, expressed in UV coords inside the rect (0 means left, top - 1 means right, bottom). Default value (null) == center of the quad (0.5f, 0.5f)


Parameters
pDashMultiplierDash frequency multiplier (min = 0.1, max = 10, default = 3)

◆ DrawDashedRect()

static void GraphicDNA.Drawing2D.DrawDashedRect ( Rect  pRect,
Color  color,
float  lineWidth,
float  pDashMultiplier = 3 
)
inlinestatic

Draws a rectangle (draws the four sides of it)

Parameters
pRectRectangle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
colorColor of the rectangle.
lineWidthLine thickness, in pixels
pDashMultiplierDash frequency multiplier (min = 0.1, max = 10, default = 3)

◆ DrawDashedTriangle()

static void GraphicDNA.Drawing2D.DrawDashedTriangle ( Vector2  pA,
Vector2  pB,
Vector2  pC,
Color  color,
float  lineWidth,
float  pDashMultiplier = 3 
)
inlinestatic

Draws a Triangle, defined by 3 points.

Parameters
pAFirst point of the triangle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pBSecond point of the triangle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pCThird point of the triangle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
colorColor of the triangle
lineWidthLine thickness, in pixels
pDashMultiplierDash frequency multiplier (min = 0.1, max = 10, default = 3)

◆ DrawGUIText() [1/3]

static void GraphicDNA.Drawing2D.DrawGUIText ( string  pText,
float  pX,
float  pY,
GUIStyle  pTextStyle 
)
inlinestatic

Draws text using GUI Label capabilities and TextStyles (compatible with OnGui methods only)

Parameters
pTextText to draw
pXX coord of the TopLeft corner of the text (use relative coordinates to parent only if BeginGroup has been used, use absolute screen coords otherwise)
pYY coord of the TopLeft corner of the text (use relative coordinates to parent only if BeginGroup has been used, use absolute screen coords otherwise)
pTextStyleCustom Text Style

◆ DrawGUIText() [2/3]

static void GraphicDNA.Drawing2D.DrawGUIText ( string  pText,
float  pX,
float  pY,
int  pFontSize,
Color  pColor 
)
inlinestatic

Draws text using GUI Label capabilities and TextStyles (compatible with OnGui methods only)

Parameters
pTextText to draw
pXX coord of the TopLeft corner of the text (use relative coordinates to parent only if BeginGroup has been used, use absolute screen coords otherwise)
pYY coord of the TopLeft corner of the text (use relative coordinates to parent only if BeginGroup has been used, use absolute screen coords otherwise)
pFontSizeFont size
pColorColor of the text

◆ DrawGUIText() [3/3]

static void GraphicDNA.Drawing2D.DrawGUIText ( string  pText,
Vector2  pPos,
int  pFontSize,
Color  pColor 
)
inlinestatic

Draws text using GUI Label capabilities and TextStyles (compatible with OnGui methods only)

Parameters
pTextText to draw
pPosCoords of the TopLeft corner of the text (use relative coordinates to parent only if BeginGroup has been used, use absolute screen coords otherwise)
pFontSizeFont size
pColorColor of the text

◆ DrawHexagon() [1/2]

static void GraphicDNA.Drawing2D.DrawHexagon ( Vector2  center,
float  radius,
Color  color,
float  lineWidth 
)
inlinestatic

Draws a Hexagon.

Parameters
centerCenter of the Hexagon (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
radiusRadius, in pixels
colorColor of the pentagon
lineWidthLine thickness, in pixels

◆ DrawHexagon() [2/2]

static void GraphicDNA.Drawing2D.DrawHexagon ( Vector2  center,
float  radius,
Color  color,
float  lineWidth,
Texture2D  pLineTexture 
)
inlinestatic

Draws a Hexagon.

Parameters
centerCenter of the Hexagon (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
radiusRadius, in pixels
colorColor of the pentagon
lineWidthLine thickness, in pixels
pLineTextureCustom texture to use as base fill (null to use default fill)

◆ DrawLine() [1/5]

static void GraphicDNA.Drawing2D.DrawLine ( Vector2  p1,
Vector2  p2,
Color  color,
float  lineWidth,
Texture2D  pOverrideTexture = null,
Vector2?  pTilingMultiplier = null 
)
inlinestatic

Draws a line between two points, using a customized base texture to fill the segment.

Parameters
p1First point of the line (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
p2Second point of the line (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
colorColor of the line
lineWidthLine thickness, in pixels
pOverrideTextureCustom texture to use as base fill (null to use default fill)
pTilingMultiplierNumber of repetitions of the texture in U,V (null to use default, with 1 repetition in each direction)

◆ DrawLine() [2/5]

static void GraphicDNA.Drawing2D.DrawLine ( Vector2  pointA,
Vector2  pointB 
)
inlinestatic

Draws a line between two points. GUI.ContentColor is assumed to draw the line.

Parameters
pointAFirst point of the line (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pointBSecond point of the line (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)

◆ DrawLine() [3/5]

static void GraphicDNA.Drawing2D.DrawLine ( Vector2  pointA,
Vector2  pointB,
Color  color 
)
inlinestatic

Draws a line between two points.

Parameters
pointAFirst point of the line (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pointBSecond point of the line (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
colorColor of the line

◆ DrawLine() [4/5]

static void GraphicDNA.Drawing2D.DrawLine ( Vector2  pointA,
Vector2  pointB,
Color  color,
float  width 
)
inlinestatic

Draws a line between two points.

Parameters
pointAFirst point of the line (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pointBSecond point of the line (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
colorColor of the line
widthLine thickness, in pixels

◆ DrawLine() [5/5]

static void GraphicDNA.Drawing2D.DrawLine ( Vector2  pointA,
Vector2  pointB,
float  width 
)
inlinestatic

Draws a line between two points. GUI.ContentColor is assumed to draw the line.

Parameters
pointAFirst point of the line (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pointBSecond point of the line (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
widthLine thickness, in pixels

◆ DrawLines() [1/3]

static void GraphicDNA.Drawing2D.DrawLines ( Vector2[]  pPointPairs,
Color  pColor 
)
inlinestatic

Draws lines with thickness == 1, using GUI 2D points.

Parameters
pPointPairsPairs of points, with the start-end points for each line (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pColorColor of all lines

◆ DrawLines() [2/3]

static void GraphicDNA.Drawing2D.DrawLines ( Vector2[]  pPointPairs,
Color  pColor,
float  lineWidth,
Texture2D  pOverrideTexture = null,
Vector2?  pTilingMultiplier = null,
bool  pFixLineCorners = true 
)
inlinestatic

Draws lines, using OpenGL Vector3 points in homogeneous coords. Please use the BuildGLVertexBuffer method to convert from GUI coordinates to OpenGL homogeneous coordinates.

Parameters
pPointPairsPairs of points, with the start-end points for each line (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pColorColor of all lines
lineWidthLine thickness, in pixels
pOverrideTextureTexture to overlay (null to use only color)
pTilingMultiplierTiling multiplier or null for default tiling (1, 1)
pFixLineCornersIf true, fixes line corners considering the line to be continuous. Looks better but it's significantly slower (default = true)

◆ DrawLines() [3/3]

static void GraphicDNA.Drawing2D.DrawLines ( Vector3[]  vertexBuffer,
Color  pColor 
)
inlinestatic

Draws lines with thickness == 1, using OpenGL Vector3 points in homogeneous coords. Please use the BuildGLVertexBuffer method to convert from GUI coordinates to OpenGL homogeneous coordinates.

Parameters
vertexBufferPairs of points in homogeneous coordinates, valid for OpenGL rendering with an Ortho projection matrix
pColorColor of all lines

◆ DrawOctogon() [1/2]

static void GraphicDNA.Drawing2D.DrawOctogon ( Vector2  center,
float  radius,
Color  color,
float  lineWidth 
)
inlinestatic

Draws a Octogon.

Parameters
centerCenter of the Octogon (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
radiusRadius, in pixels
colorColor of the pentagon
lineWidthLine thickness, in pixels

◆ DrawOctogon() [2/2]

static void GraphicDNA.Drawing2D.DrawOctogon ( Vector2  center,
float  radius,
Color  color,
float  lineWidth,
Texture2D  pLineTexture 
)
inlinestatic

Draws a Octogon.

Parameters
centerCenter of the Octogon (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
radiusRadius, in pixels
colorColor of the pentagon
lineWidthLine thickness, in pixels
pLineTextureCustom texture to use as base fill (null to use default fill)

◆ DrawPentagon() [1/2]

static void GraphicDNA.Drawing2D.DrawPentagon ( Vector2  center,
float  radius,
Color  color,
float  lineWidth 
)
inlinestatic

Draws a pentagon.

Parameters
centerCenter of the pentagon (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
radiusRadius, in pixels
colorColor of the pentagon
lineWidthLine thickness, in pixels

◆ DrawPentagon() [2/2]

static void GraphicDNA.Drawing2D.DrawPentagon ( Vector2  center,
float  radius,
Color  color,
float  lineWidth,
Texture2D  pLineTexture 
)
inlinestatic

Draws a pentagon.

Parameters
centerCenter of the pentagon (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
radiusRadius, in pixels
colorColor of the pentagon
lineWidthLine thickness, in pixels
pLineTextureCustom texture to use as base fill (null to use default fill)

◆ DrawPoint() [1/2]

static void GraphicDNA.Drawing2D.DrawPoint ( Vector2  pPoint,
Color  color 
)
inlinestatic

Draws a point.

Parameters
pPointCoordinates of the point (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
colorColor of the point

◆ DrawPoint() [2/2]

static void GraphicDNA.Drawing2D.DrawPoint ( Vector2  pPoint,
Color  color,
float  pSize 
)
inlinestatic

Draws a point.

Parameters
pPointCoordinates of the point (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
colorColor of the point
pSizeSize of the point, in pixels

◆ DrawPolygon() [1/5]

static void GraphicDNA.Drawing2D.DrawPolygon ( Vector2[]  pVertices)
inlinestatic

Draws a closed polygon (draws a line between each pair of vertices, in order, and one closing line between the last and the first) Assumes GUI.ContentColor.

Parameters
pVerticesArray of vertices of the polygon (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)

◆ DrawPolygon() [2/5]

static void GraphicDNA.Drawing2D.DrawPolygon ( Vector2[]  pVertices,
Color  color 
)
inlinestatic

Draws a closed polygon (draws a line between each pair of vertices, in order, and one closing line between the last and the first)

Parameters
pVerticesArray of vertices of the polygon (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
colorColor of the polygon

◆ DrawPolygon() [3/5]

static void GraphicDNA.Drawing2D.DrawPolygon ( Vector2[]  pVertices,
Color  color,
float  lineWidth 
)
inlinestatic

Draws a closed polygon (draws a line between each pair of vertices, in order, and one closing line between the last and the first)

Parameters
pVerticesArray of vertices of the polygon (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
colorColor of the polygon
lineWidthLine thickness, in pixels

◆ DrawPolygon() [4/5]

static void GraphicDNA.Drawing2D.DrawPolygon ( Vector2[]  pVertices,
Color  color,
float  lineWidth,
Texture2D  pLineTexture 
)
inlinestatic

Draws a closed polygon (draws a line between each pair of vertices, in order, and one closing line between the last and the first)

Parameters
pVerticesArray of vertices of the polygon (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
colorColor of the polygon
lineWidthLine thickness, in pixels
pLineTextureCustom texture to use as base fill (null to use default fill)

◆ DrawPolygon() [5/5]

static void GraphicDNA.Drawing2D.DrawPolygon ( Vector2[]  pVertices,
Color  color,
float  lineWidth,
Texture2D  pLineTexture,
bool  pLeaveOpen,
bool  pFixLineCorners = true 
)
inlinestatic

Draws a closed or open polygon (draws a line between each pair of vertices, in order, and if pLeaveOpen is false, draws a closing line between the last and the first)

Parameters
pVerticesArray of vertices of the polygon, plain list, not point pairs (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
colorColor of the polygon
lineWidthLine thickness, in pixels
pLineTextureCustom texture to use as base fill (null to use default fill)
pLeaveOpenTrue to leave the polygon open. False to close it with a final line between the last and first vertices
pFixLineCornersIf true, fixes line corners considering the line to be continuous. Looks better but it's significantly slower (default = true)

◆ DrawQuad()

static void GraphicDNA.Drawing2D.DrawQuad ( Vector2  pCenter,
float  pWidth,
float  pHeight,
Color  pColor,
float  pLineWidth,
float?  pOrientationDeg = null,
Vector2?  pRotationCenter01 = null,
Texture2D  pOverrideTexture = null 
)
inlinestatic

Fills a quad with an arbitrary orientation.

Parameters
pCenterCenter of the quad (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pWidthWidth of the quad, in pixels
pHeightHeight of the quad, in pixels
pColorColor of the quad
pLineWidthLine thickness, in pixels
pOrientationOrientation of the quad, in degrees, or null to use default
pRotationCenter01Rotation center, or pivot point, expressed in UV coords inside the rect (0 means left, top - 1 means right, bottom). Default value (null) == center of the quad (0.5f, 0.5f)


Parameters
pOverrideTextureFill texture to overlay, or null to use color only

◆ DrawRect() [1/4]

static void GraphicDNA.Drawing2D.DrawRect ( Rect  pRect)
inlinestatic

Draws a rectangle (draws the four sides of it). GUI.ContentColor is assumed.

Parameters
pRectRectangle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)

◆ DrawRect() [2/4]

static void GraphicDNA.Drawing2D.DrawRect ( Rect  pRect,
Color  color 
)
inlinestatic

Draws a rectangle (draws the four sides of it)

Parameters
pRectRectangle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
colorColor of the rectangle.

◆ DrawRect() [3/4]

static void GraphicDNA.Drawing2D.DrawRect ( Rect  pRect,
Color  color,
float  lineWidth 
)
inlinestatic

Draws a rectangle (draws the four sides of it)

Parameters
pRectRectangle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
colorColor of the rectangle.
lineWidthLine thickness, in pixels

◆ DrawRect() [4/4]

static void GraphicDNA.Drawing2D.DrawRect ( Rect  pRect,
Color  color,
float  lineWidth,
Texture2D  pTexture 
)
inlinestatic

Draws a rectangle (draws the four sides of it)

Parameters
pRectRectangle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
colorColor of the rectangle.
lineWidthLine thickness, in pixels
pTextureCustom texture to use as base fill (null to use default fill)

◆ DrawRects()

static void GraphicDNA.Drawing2D.DrawRects ( IList< Rect >  pRects,
Color  pColor,
bool  pClearFrameBufferColor = false 
)
inlinestatic

Draws Rects using OpenGL, ideal for performance critical situations. Please note: Rects drawn using OpenGL are not affected by clipping.

Parameters
pRectsList of rectangles to draw (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pColorColor of all rects
pClearFrameBufferColorTrue to clear the whole frame buffer, false otherwise

◆ DrawText() [1/3]

static void GraphicDNA.Drawing2D.DrawText ( string  pText,
float  pX,
float  pY,
float  pRotationDegs,
float  pTextWorldSizePixels,
Color  pColor,
BitmapFont  pFont,
bool  pRightAlign = false 
)
inlinestatic

Draws text using BitmapFonts (compatible with OnGUI and OnPostRender methods)

Parameters
pTextText to draw
pXX coord of the TopLeft corner of the text (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pYY coord of the TopLeft corner of the text (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pRotationDegsRotation of text, in degrees
pTextWorldSizePixelsText world height, in pixels
pColorColor of the text
pFontBitmapFont to be used for rendering

◆ DrawText() [2/3]

static void GraphicDNA.Drawing2D.DrawText ( string  pText,
float  pX,
float  pY,
int  pFontSize,
Color  pColor,
BitmapFont  pFont,
bool  pRightAlign = false 
)
inlinestatic

Draws text using BitmapFonts (compatible with OnGUI and OnPostRender methods)

Parameters
pTextText to draw
pXX coord of the TopLeft corner of the text (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pYY coord of the TopLeft corner of the text (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pFontSizeFont size
pColorColor of the text
pFontBitmapFont to be used for rendering

◆ DrawText() [3/3]

static void GraphicDNA.Drawing2D.DrawText ( string  pText,
Vector2  pPos,
int  pFontSize,
Color  pColor,
BitmapFont  pFont,
bool  pRightAlign = false 
)
inlinestatic

Draws text using BitmapFonts (compatible with OnGUI and OnPostRender methods)

Parameters
pTextText to draw
pPosCoords of the TopLeft corner of the text (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pFontSizeFont size
pColorColor of the text
pFontBitmapFont to be used for rendering

◆ DrawTexture()

static void GraphicDNA.Drawing2D.DrawTexture ( Rect  pRect,
Color  color,
Texture2D  pTexture 
)
inlinestatic

Draws a texture.

Parameters
pRectRectangle in the screen to draw the texture (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
colorColor that will be multiplied to the texture (white for no effect)
pTextureTexture to draw

◆ DrawTriangle() [1/2]

static void GraphicDNA.Drawing2D.DrawTriangle ( Vector2  pA,
Vector2  pB,
Vector2  pC,
Color  color,
float  lineWidth 
)
inlinestatic

Draws a Triangle, defined by 3 points.

Parameters
pAFirst point of the triangle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pBSecond point of the triangle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pCThird point of the triangle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
colorColor of the triangle
lineWidthLine thickness, in pixels

◆ DrawTriangle() [2/2]

static void GraphicDNA.Drawing2D.DrawTriangle ( Vector2  pA,
Vector2  pB,
Vector2  pC,
Color  color,
float  lineWidth,
Texture2D  pLineTexture 
)
inlinestatic

Draws a Triangle, defined by 3 points.

Parameters
pAFirst point of the triangle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pBSecond point of the triangle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pCThird point of the triangle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
colorColor of the triangle
lineWidthLine thickness, in pixels
pLineTextureCustom texture to use as base fill (null to use default fill)

◆ FillCircle() [1/3]

static void GraphicDNA.Drawing2D.FillCircle ( Vector2  center,
float  radius 
)
inlinestatic

Fills a circle, using GUI.Content color.

Parameters
centerCenter of the circle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
radiusRadius of the circle, in Pixels

◆ FillCircle() [2/3]

static void GraphicDNA.Drawing2D.FillCircle ( Vector2  center,
float  radius,
Color  color 
)
inlinestatic

Fills a circle.

Parameters
centerCenter of the circle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
radiusRadius of the circle, in Pixels
colorColor of the circle

◆ FillCircle() [3/3]

static void GraphicDNA.Drawing2D.FillCircle ( Vector2  center,
float  radius,
Color  color,
Texture2D  pCircleTexture 
)
inlinestatic

Fills a circle.

Parameters
centerCenter of the circle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
radiusRadius of the circle, in Pixels
colorColor of the circle
pCircleTextureCustom base texture to perform the fill (must be round texture to keep the circle shape)

◆ FillPolygonConvex()

static void GraphicDNA.Drawing2D.FillPolygonConvex ( Vector2[]  pVertices,
Color  color 
)
inlinestatic

Fills a polygon, with the requisite that polygon is convex. If it's a concave polygon, this method won't work.

Parameters
pVerticesVertices of the convex polygon
color

◆ FillPolygonTriStrip() [1/2]

static void GraphicDNA.Drawing2D.FillPolygonTriStrip ( Vector2[]  pVertices,
Color  color 
)
inlinestatic

Fills a polygon with triangles.

Parameters
pVerticesVertices forming the polygon, arranged as a Triangle Strip
color

◆ FillPolygonTriStrip() [2/2]

static void GraphicDNA.Drawing2D.FillPolygonTriStrip ( Vector2[]  pVertices,
Color  color,
Vector2[]  pUVCoords,
Texture2D  pTexture 
)
inlinestatic

Fills a polygon with triangles.

Parameters
pVerticesVertices forming the polygon, arranged as a Triangle Strip
color
pUVCoordsUV coords of the vertices
pTexture

◆ FillQuad()

static void GraphicDNA.Drawing2D.FillQuad ( Vector2  pCenter,
float  pWidth,
float  pHeight,
Color  pColor,
float?  pRotationDeg = null,
Vector2?  pRotationCenter01 = null,
Texture2D  pOverrideTexture = null,
Vector2?  pTilingMultiplier = null 
)
inlinestatic

Fills a quad with an arbitrary orientation.

Parameters
pCenterCenter of the quad (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pWidthWidth of the quad, in pixels
pHeightHeight of the quad, in pixels
pColorColor of the quad
pOrientationOrientation of the quad, in degrees, or null to use default
pRotationCenter01Rotation center, or pivot point, expressed in UV coords inside the rect (0 means left, top - 1 means right, bottom). Default value (null) == center of the quad (0.5f, 0.5f)
pOverrideTextureFill texture to overlay, or null to use color only
pTilingMultiplierTiling multiplier or null for default tiling (1, 1)

◆ FillQuadFullScreen() [1/2]

static void GraphicDNA.Drawing2D.FillQuadFullScreen ( Color  color)
inlinestatic

WIP.

Parameters
previewRect

◆ FillQuadFullScreen() [2/2]

static void GraphicDNA.Drawing2D.FillQuadFullScreen ( Color  color,
Texture2D  pOverrideTexture = null,
Vector2?  pTilingMultiplier = null 
)
inlinestatic

WIP.

Parameters
previewRect

◆ FillQuads() [1/3]

static void GraphicDNA.Drawing2D.FillQuads ( Vector2[]  pVertices,
Color  color 
)
inlinestatic

Fills quads defined by their list of vertices. Each quad is defined by its 4 vertices in the following order: BL, TL, TR, BR.

Parameters
pVerticesVertices of the Quads in the following order: BL, TL, TR, BR (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
colorColor of all quads

◆ FillQuads() [2/3]

static void GraphicDNA.Drawing2D.FillQuads ( Vector2[]  pVertices,
Color  color,
Texture2D  pOverrideTexture,
Vector2?  pTilingMultiplier = null 
)
inlinestatic

Fills quads defined by their list of vertices. Each quad is defined by its 4 vertices in the following order: BL, TL, TR, BR.

Parameters
pVerticesVertices of the Quad in the following order: BL, TL, TR, BR (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
colorColor of the quad
pOverrideTextureTexture to overlay, if any
pTilingMultiplierTiling multiplier or null for default tiling (1, 1)

◆ FillQuads() [3/3]

static void GraphicDNA.Drawing2D.FillQuads ( Vector2[]  pVertices,
Vector2[]  pTexCoords,
Color  color,
Texture2D  pOverrideTexture 
)
inlinestatic

Fills quads defined by their list of vertices Each quad is defined by its 4 vertices in the following order: BL, TL, TR, BR.

Parameters
pVerticesVertices of the Quad in the following order: BL, TL, TR, BR (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pTexCoordsTexCoords of each vertex
colorColor of the quad
pOverrideTextureTexture to overlay, if any
pTilingMultiplierTiling multiplier or null for default tiling (1, 1)

◆ FillRect() [1/3]

static void GraphicDNA.Drawing2D.FillRect ( Rect  pRect)
inlinestatic

Fills a rectange. GUI.ContentColor is assumed.

Parameters
pRectRectangle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)

◆ FillRect() [2/3]

static void GraphicDNA.Drawing2D.FillRect ( Rect  pRect,
Color  color 
)
inlinestatic

Fills a rectange.

Parameters
pRectRectangle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
colorColor of the rectangle

◆ FillRect() [3/3]

static void GraphicDNA.Drawing2D.FillRect ( Rect  pRectangle,
Color  pColor,
Texture2D  pTexture = null,
Vector2?  pTilingMultiplier = null 
)
inlinestatic

Fills a rectange.

Parameters
pRectangleRectangle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pColorColor of the rectangle
pTextureCustom texture to use as base fill (null to use default fill)
pTilingMultiplierNumber of repetitions of the texture in U,V (null to use default (1, 1))

◆ FillTriangle()

static void GraphicDNA.Drawing2D.FillTriangle ( Vector2  pA,
Vector2  pB,
Vector2  pC,
Color  color,
Texture2D  pOverrideTexture = null,
Vector2?  pTilingMultiplier = null 
)
inlinestatic
Parameters
pAFirst point of the triangle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pBSecond point of the triangle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
pCThird point of the triangle (use relative coordinates to parent only if SetViewport has been used, use absolute screen coords otherwise)
colorColor of the Triangle
pOverrideTextureTexture to overlay (null to use color only)
pTilingMultiplierNumber of repetitions of the texture in U,V (null to use default (1, 1))

◆ FillTriangleStrip()

static void GraphicDNA.Drawing2D.FillTriangleStrip ( Vector2[]  pTrianglePoints,
Color  color,
Vector2[]  pUVCoords = null,
Texture2D  pOverrideTexture = null,
Vector2?  pTilingMultiplier = null 
)
inlinestatic
Parameters
pTrianglePointsArray of points forming the triangle strip
colorColor of the Triangle
pOverrideTextureTexture to overlay (null to use color only)
pTilingMultiplierNumber of repetitions of the texture in U,V (null to use default (1, 1))

◆ GetWorldRect()

static Rect GraphicDNA.Drawing2D.GetWorldRect ( RectTransform  pTransform)
inlinestatic

Returns the world position and size of a UI element (provided its RectTransform) The returned position corresponds to the Top-Left corner of the element.

Parameters
pTransformRectTransform of the UI Element

◆ MeasureText()

static Vector2 GraphicDNA.Drawing2D.MeasureText ( string  pText,
float  pTextWorldSizePixels,
BitmapFont  pFont 
)
inlinestatic

Measures the world size of a string, when rendered with the provided font and fontsize.

Parameters
pTextText to draw
pTextWorldSizePixelsText world height, in pixels
pFontBitmapFont to be used for rendering

◆ SetParentBounds()

static void GraphicDNA.Drawing2D.SetParentBounds ( Rect  pRect)
inlinestatic

[DEPRECATED]: This method will be removed in the future. Please use SetViewport instead Sets the coordinate system for drawing operations so the (0,0) is the top-left corner of the group. Use this method from outside OnGui code parts, like OnPostRender methods. If pClip is enabled, all controls are clipped to the group. Groups CANNOT be nested

Please note: Do not use GUI.BeginGroup to achieve this, as that might result in a malfunction of the drawing features

Parameters
pRectParent rectangle to use as a reference
pClipTrue to enable clipping to this rectangle

◆ SetViewport()

static void GraphicDNA.Drawing2D.SetViewport ( Vector2  pCoords,
int  pScreenWidth,
int  pScreenHeight,
bool  pFlipYCoords = true 
)
inlinestatic

Sets the origin of the coordinate system for drawing operations so the (0,0)

Parameters
pCoordsOrigin coords to use as a reference
pFlipYCoordsTrue to enable flip coords in the Y Direction (for example, if the origin is in the bottom left corner, and you want it to be in the topleft corner)

The documentation for this class was generated from the following file: