Udostępnij za pośrednictwem


Small Basic - How to change the thickness and color of your lines

First of all, drop in this code to draw a line:

 

GraphicsWindow.Title    = "Line Time"

GraphicsWindow.DrawLine(10,70,130,70)

 

If you want to change the thickness or color of the line, use the PenWidth and PenColor properties of the GraphicsWindow object. For example, to draw with a thicker, green pen, update your program like this:

 

GraphicsWindow.Title    = "Lime Time"

GraphicsWindow.PenWidth = 3        'Try different numbers

GraphicsWindow.PenColor = "Green"  'Try different colors

GraphicsWindow.DrawLine(10,70,130,70)

'Continue your program

     

After you make that change, run your program again to see what’s different. Now experiment with some colors and different pen widths!

All the colors are listed here:

Small Basic Getting Started Guide: Appendix B: Colors

 

Have a Small and Basic week!

   - User Ed & Majed Marji

Comments