Difference between revisions of "Bounds.corners"
Jump to navigation
Jump to search
(Created page with "<c>Bounds.corners</c> returns the four corners of the bounds as a list of <c>[x, y]</c> pairs. === Usage Notes === The result of this call may be passed directly to Pi...") |
|||
Line 6: | Line 6: | ||
=== Example === | === Example === | ||
+ | |||
+ | <ms>b = new Bounds | ||
+ | b.x = 480 | ||
+ | b.y = 320 | ||
+ | b.width = 200 | ||
+ | b.height = 100 | ||
+ | b.rotation = 90 | ||
+ | print b.corners</ms> | ||
+ | |||
+ | The above prints <c>[[530, 220], [430, 220], [430, 420], [530, 420]]</c>, representing the four corners of the rotated bounds. | ||
[[Category:Mini Micro]] | [[Category:Mini Micro]] |
Latest revision as of 16:59, 8 July 2021
Bounds.corners
returns the four corners of the bounds as a list of [x, y]
pairs.
Usage Notes
The result of this call may be passed directly to PixelDisplay.drawPoly or PixelDisplay.fillPoly, assuming the bounds is in the same coordinate system as that display.
Example
b = new Bounds
b.x = 480
b.y = 320
b.width = 200
b.height = 100
b.rotation = 90
print b.corners
The above prints [[530, 220], [430, 220], [430, 420], [530, 420]]
, representing the four corners of the rotated bounds.