DrawRect Replacement

BlitzMax Forums/BlitzMax Beginners Area/DrawRect Replacement

RetroRusty(Posted 2009) [#1]
Has anyone got a function that replaces DrawRect with an option to have the rect solid or not?


GfK(Posted 2009) [#2]
Something like:
Function DrawRect2(x:int,y:int,w:int,h:int,filled:byte = true)
  Select filled
    Case False
      DrawLine x,y,x+w,y
      DrawLine x+w,y,x+w,y+h
      DrawLine x+w,y+h,x,y+h
      DrawLine x,y+h,x,y
    Case True
      DrawRect x,y,w,h
  End Select
End Function



RetroRusty(Posted 2009) [#3]
That does just the job, thanks Gfk.


GfK(Posted 2009) [#4]
I typed it straight into the reply box so it might not work right with scaling/rotation, but I guess you'll be able to iron out the wrinkles as you find them.


tonyg(Posted 2009) [#5]
... and this might help.