Be careful calling it a viewport because it’s not a viewport in the AM sense. Just think it may confuse someone reading this at a later date.Keith Baxter wrote: ↑Wed Apr 28, 2021 2:13 pm Hi,
A bit more code but _arc() ,_quad_to() ,_ellipse(), _bezier_to() can be used to create shaped viewports.
Note how the last three line in the draw overlap. This is to ensure an overlap. In you version there are transparencies where the rectangles join/meet. I suggest you make them overlap a px or two. But you got the idea.Code: Select all
img_cover=canvas_add(0,0,800,400) canvas_draw(img_cover, function() _move_to(200,50) _line_to(600,50) _line_to(600,350) _line_to(200,350) _line_to(200,0) _line_to(0,0) _line_to(0,400) _line_to(800,400) _line_to(800,0) _line_to(199,0) _line_to(199,50) _line_to(200,50) _fill("red") end)
Keith
Draw hole in a canvas
Re: Draw hole in a canvas
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D