Difference between revisions of "Path2D:setPath"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2016.04<br/> === Description === Set path to draw, using string with commands represented as: <ul> <li>M - MoveTo, 2 values (x,y)</li>...")
 
Line 16: Line 16:
 
and provided coordinates as table or simply arguments
 
and provided coordinates as table or simply arguments
 
<source lang="lua">
 
<source lang="lua">
= Path2D:setPath(commandscoordinatesmore coordinates,)
+
Path2D:setPath(commands,coordinates,more coordinates)
 
</source>
 
</source>
'''commands:''' (string) list of commands as ML**Z expecting according coordinates ''''''<br/>
+
'''commands''': (string) list of commands as ML**Z expecting according coordinates ''''''<br/>
'''coordinates:''' (table or number) lua table with coordinates for each command, in the same order as commands ''''''<br/>
+
'''coordinates''': (table or number) lua table with coordinates for each command, in the same order as commands ''''''<br/>
'''more coordinates:''' (number) if second argument is not table, you can provide more coordinates as separate arguments '''optional'''<br/>
+
'''more coordinates''': (number) if second argument is not table, you can provide more coordinates as separate arguments '''optional'''<br/>

Revision as of 10:21, 23 August 2018

Available since: Gideros 2016.04

Description

Set path to draw, using string with commands represented as:

  • M - MoveTo, 2 values (x,y)
  • L - LineTo, 2 values (x,y)
  • Q - QuadTo, 4 values (c0x,c0y,x,y)
  • C - CubicTo, 6 values (c0x,c0y,c1x,c1y,x,y)
  • H - Horzontal Line, 1 value (x)
  • V - Vertical Line, 1 value (y)
  • A - ArcTo, 7 values (r1,r2,angle,largeArc,sweep,x,y)
  • Z - Close, no parameter
  • * - repeat last command until all coordinates are exhausted

and provided coordinates as table or simply arguments

 Path2D:setPath(commands,coordinates,more coordinates)

'commands: (string) list of commands as ML**Z expecting according coordinates '
'coordinates: (table or number) lua table with coordinates for each command, in the same order as commands '
more coordinates: (number) if second argument is not table, you can provide more coordinates as separate arguments optional