User Tools

Site Tools


el:spritepoly

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

el:spritepoly [2016/01/01 22:40]
el:spritepoly [2020/02/28 10:46] (current)
Line 1: Line 1:
 +===== Spritepoly =====
 +==== Format ====
 +**spritepoly** //n//, {x1, y1, x2, y2, x3, y3 ...}\\
 +**spritepoly** //n//, numeric array
 +
 +==== Description ====
 +
 +Create a sprite from a list of points that represent a polygon.  The top left corner of the ploygon should be (0,0).
 +
 +==== Example ====
 +<code>
 +# create an arrow that spins and follows the mouse
 +spritedim 1
 +color darkblue, blue
 +penwidth 2
 +spritepoly 0, {15,0, 30,10, 25,10, 25,30, 5,30, 5,10, 0,10}
 +
 +color grey
 +rect 0,0,300,300
 +spriteshow 0
 +s = 1
 +ds = .1
 +r = 0
 +while true
 +   spriteplace 0, mousex, mousey, s, r
 +   r = r + .1
 +   if s > 5 or s < 1 then ds = ds * -1
 +   s = s + ds
 +   pause .1
 +end while</code>
 +==== See Also ====
 +[[Poly|Poly]], {{page>en:start#Graphics - sprites&noheader}}
 +==== New To Version ==== 
 +0.9.9.70
  
el/spritepoly.txt ยท Last modified: 2020/02/28 10:46 (external edit)