Post by Admin on Jan 6, 2020 4:12:29 GMT
Basically it is a tool that allows you to create a rectangle that always has the first two
coordinates at the bottom left side of the rectangle.
The reasoning behind it was that when you look for such a rectangle, it is always from bottom to top and
left to right and coordinate based lower and upper coordinate drawing for depth designs and the such.
It is related to SBOX and other tools that use exact x,y- w,h coordinate system requirements.(width/height)
x,y is lower left edge and w,h is top right coordinates
You may prefer traditional method within BBC BASIC and so RECTANGLE command may suit your needs better
* RECTANGLE x, y, width, height - x,y is start coordinates---(width is the distance from x) (height is distance from y)
* PROCrect(x%,y,w%,h%) - (x%,y% is start coordinates) (w%,h% is end coordinates) ---> not the same as RECTANGLE
Example:
PROCrect(100,100,200,250)
Example2:
PROCrect(100,100,0,200)
REM Now why would someone do that? - because when you are designing something you may be starting at
REM another location you finished earlier and wanted to work towards another zone. Like say in border zone designs
REM Regardless, you will see many examples in RETROLIB 10 where this command is used to support other commands.
coordinates at the bottom left side of the rectangle.
The reasoning behind it was that when you look for such a rectangle, it is always from bottom to top and
left to right and coordinate based lower and upper coordinate drawing for depth designs and the such.
It is related to SBOX and other tools that use exact x,y- w,h coordinate system requirements.(width/height)
x,y is lower left edge and w,h is top right coordinates
You may prefer traditional method within BBC BASIC and so RECTANGLE command may suit your needs better
* RECTANGLE x, y, width, height - x,y is start coordinates---(width is the distance from x) (height is distance from y)
* PROCrect(x%,y,w%,h%) - (x%,y% is start coordinates) (w%,h% is end coordinates) ---> not the same as RECTANGLE
Example:
PROCrect(100,100,200,250)
Example2:
PROCrect(100,100,0,200)
REM Now why would someone do that? - because when you are designing something you may be starting at
REM another location you finished earlier and wanted to work towards another zone. Like say in border zone designs
REM Regardless, you will see many examples in RETROLIB 10 where this command is used to support other commands.
REM RECT **********************
DEFPROCrect(x%,y%,w%,h%)
LOCAL sx%,sy%
sx%=x%:sy%=y%
IF x%>w% THEN x%=w%:w%=sx%
IF y%>h% THEN y%=h%:h%=sy%
LINE x%,y%,w%,y%
LINE w%,y%,w%,h%
LINE w%,h%,x%,h%
LINE x%,h%,x%,y%
ENDPROC