Shop OBEX P1 Docs P2 Docs Learn Events
Help with Propeller programming. — Parallax Forums

Help with Propeller programming.

chelletengchelleteng Posts: 29
edited 2012-03-19 08:59 in General Discussion
Chip Gracey's Graphic Demo program codes.

How to clear only certain parts of the screen and not all of it? Why is it that the draw line code only allows two parameters and not four?
Thanks.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-03-15 07:34
    To clear a region of the screen, you have to draw a solid rectangle using the background color over the area of the screen you want to clear.

    The draw line code is intended for drawing polygons. You have to plot a starting point, then draw a line from the last (now implied) point to a new point. If you draw a 2nd line segment, it starts at the end of the last one.
  • chelletengchelleteng Posts: 29
    edited 2012-03-17 06:39
    Thank you! The default color set is rainbow colored. How do I change the color?
  • Mike GreenMike Green Posts: 23,101
    edited 2012-03-17 06:55
    If you initialized the screen to a rainbow, you will have to go back and re-draw the portion of the rainbow that occupies the area you want to clear. If, by rainbow, you mean that the color palette has lots of different colors in it, you have to choose which one you want to use. Look at the comments in Graphics.spin for the routines "color" and "quad".
  • chelletengchelleteng Posts: 29
    edited 2012-03-19 08:59
    Alright! Thanks so much Mike! :)
Sign In or Register to comment.