October 28, 2020, 11:22:33 PM

Author Topic: [bb] draw rectangle by stanrol [ 1+ years ago ]  (Read 1511 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] draw rectangle by stanrol [ 1+ years ago ]
« on: June 29, 2017, 12:28:43 AM »
Title : draw rectangle
Author : stanrol
Posted : 1+ years ago

Description : Code for drawing rectangles given point origin and width & height.

Code :
Code: BlitzBasic
  1. Function rec(x,y,w,h)
  2. Line x,y,x+w,y
  3. Line x+w,y,x+w,y+h
  4. Line x+w,y+h,x,y+h
  5. Line x,y+h,x,y
  6. Return Abs(w*h)
  7. End Function
  8. Graphics 800,600,0,2
  9. Text 1,5,"Hi there this draws a rectangle"
  10. Color 22,220,79
  11. AppTitle "area is "+Rec(1,1,200,300)
  12. WaitKey


Comments :


Matty(Posted 1+ years ago)

 I'm sure you already know about the 'rect' command....I do wonder at the purpose of these posts though...


GW(Posted 1+ years ago)

 apparently to clog up the code archives with junk.


 

SimplePortal 2.3.6 © 2008-2014, SimplePortal