Class LM_Graphics

Version added: before 9.5
The LM_Graphics class is used for drawing in an LM_View. It lets you draw basic lines and shapes, and to convert between coordinate systems (the screen pixel space and the 3D coordinate system of Anime Studio layers). You typically would use an LM_Graphics object with a moho tool script to determine what object(s) the user clicks on and to draw extra tool elements like control handles.

Methods:

Name Returns Description Version added
AddLine void Add a line segment to the current enclosed shape before 9.5
ApplyMatrix void Prepend an arbitrary matrix to the current matrix transform before 9.5
BeginDraw void Call this function before starting any drawing commands before 9.5
BeginPicking void Call this function to begin testing whether the user has clicked on an object before 9.5
BeginShape void Begin drawing an enclosed shape before 9.5
Clear void Clear the drawing area before 9.5
CurrentScale real Returns the current scale of the drawing before 9.5
CurrentTransform LM_Matrix Returns the current matrix transformation before 9.5
DrawDiamondMarker void Added in version 9.5 9.5
DrawDiamondMarker void Added in version 9.5 9.5
DrawFatLine void Added in version 10 10.0
DrawFatLine2 void Added in version 11 11.0
DrawFatMarker void Draw a fat marker before 9.5
DrawLine void Draw a line between two pixels before 9.5
DrawMarker void Draw a marker (for example, the control points on Anime Studio curves) before 9.5
EndDraw void Call this function when you're finished with all drawing operations before 9.5
EndShape void End the current enclosed shape and draw it on the screen before 9.5
FillCircle void Draw a filled circle before 9.5
FillCirclePixelRadius void before 9.5
FillOval void Added in version 9.5 9.5
FloodFill bool before 9.5
FrameCircle void Draw a circle outline before 9.5
FrameCirclePixelRadius void before 9.5
FrameOval void Added in version 9.5 9.5
Height int32 Returns the height in pixels of the drawing area before 9.5
IsFullWhite bool Test whether a given pixel is 100% white before 9.5
LineTo void Draw a line from the current pen position to the given pixel before 9.5
LineTo void Draw a line from the current pen position to the given pixel before 9.5
MoveTo void Move the pen location to a given pixel before 9.5
MoveTo void Move the pen location to a given pixel before 9.5
Pick bool After drawing an object, call this function to see if it was clicked on by the user before 9.5
Pop void Pop the current matrix stack before 9.5
Push void Push the current matrix stack before 9.5
Rotate void Prepend a rotation to the current matrix transform before 9.5
Scale void Prepend a 2D scale to the current matrix transform before 9.5
ScreenToWorld void Converts a screen pixel location to 2D world coordinates before 9.5
ScreenToWorld void Converts a screen pixel location to 3D world coordinates before 9.5
SelectionRect void Draw a selection rectangle before 9.5
SetBezierTolerance void before 9.5
SetColor void Sets the drawing color for subsequent drawing operations before 9.5
SetColor void Sets the drawing color for subsequent drawing operations before 9.5
SetPenWidth void Sets the width in pixels for line drawing operations before 9.5
SetSmoothing void Turns on or off smoothing (antialaising) for drawing operations before 9.5
SetViewMode void Added in version 10 10.0
SetViewOffset void Added in version 10 10.0
SetViewPixelScaling void Added in version 10 10.0
SetViewRotation void Added in version 10 10.0
SetViewZoom void Added in version 10 10.0
Translate void Prepend a 2D translation to the current matrix transform before 9.5
ViewMode int32 Added in version 10 10.0
ViewOffset LM_Vector2 Added in version 10 10.0
ViewPixelScaling int32 Added in version 10 10.0
ViewRotation real Added in version 10 10.0
ViewZoom real Added in version 10 10.0
Width int32 Returns the width in pixels of the drawing area before 9.5
WorldToScreen bool Converts a 2D world position to a screen pixel location before 9.5
WorldToScreen bool Converts a 2D world position to a screen pixel location before 9.5