Page 126 - Learn to Program - Basic-256
P. 126

Chapter 9: Custom Graphics – Creating Your Own Shapes.                          Page 110











                           graphsize width, height

                           Set the graphics output area to the specified height and width.












                          graphwidth or graphwidth()
                          graphheight or graphheight()


                          Functions that return the current graphics height and width for
                          you to use in your program.







        Creating a Custom Polygon:


               In previous chapters we learned how to draw rectangles and circles. Often
               we want to draw other shapes. The poly statement will allow us to draw a
               custom polygon anywhere on the screen.


               Let's draw a big red arrow in the middle of the graphics output area. First,
               draw it on a piece of paper so we can visualize the coordinates of the vertices
               of the arrow shape.










                                                       © 2019 James M. Reneau (CC BY-NC-SA 3.0 US)
   121   122   123   124   125   126   127   128   129   130   131