Log In  


Cart #knutil_exrect-0 | 2023-04-24 | Code ▽ | Embed ▽ | No License
1

Feature Overview

EXRECT() creates a rectangle object with extended functionality.

  • The created rectangle object can be drawn and its inclusions and overlaps can be checked.
  • Drawing and update functions return their own objects, so they can be written in succession.
  • This function consumes 388 Token.(include comb() and cat() functions)
r = exrect('10 80 16 24') -- generate a rectangle object from a string. x:10, y:10, width:16, height:24
r.rf(6).rs(7) -- draw "r" with rectfill, and then draw it again with rect.

?r.con(13,80)  -- true
?r.con(9,80)  -- false

?r.con(exrect'12 82 8 8')  -- true
?r.con(exrect'9 82 8 8')  -- false

?r.hov(exrect'12 82 8 8')  -- true
?r.hov(exrect'9 82 8 8')  -- true

--Check the code for further applications!

This function is included in the KNUTIL library.

release note


v0.1

  • first release
1


1

That's pretty cool.



[Please log in to post a comment]