Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update 615-graphics-draw.markdown
  • Loading branch information
Joe7M authored Jan 28, 2023
commit ba868bc65d5c256d68db455c77d444744e941eb3
73 changes: 28 additions & 45 deletions _build/reference/615-graphics-draw.markdown
Original file line number Diff line number Diff line change
@@ -1,55 +1,38 @@
# DRAW

> DRAW "commands"

Draw lines as specified by the given directional commands.

*Graphics Definition Language*
In the movement instructions below, n specifies a distance to move. The number of pixels moved is equal to n multiplied by the current scaling factor, which is set by the S command.

--- ---------
Un Move up.
Dn Move down.
Ln Move left.
Rn Move right.
En Move diagonally up and right.
Fn Move diagonally down and right.
Gn Move diagonally down and left.
Hn Move diagonally up and left.
Mxy Move to coordinate x,y. If x is preceded by a + or -, the movement is relative to the last point referenced.
B A prefix command. Next movement command moves but doesn't plot.
N A prefix command. Next movement command moves, but returns immediately to previous point.
--- ---------
> DRAW CommandString

```
COLOR 9:PSET 80,80
DRAW "R50D70L25U25L15D25NR15"
DRAW "L10U50E25F25"
PSET 118,105
DRAW "R8U16L16D16R8U10NR8U6"
COLOR 12:PSET 100,117
INPUT "Who are you"; A$
? "Hello, ";A$;"!"
```

How does S command work? I just tried it in the DRAW example in first DRAW string and I get error: "DRAW: Command 'S' unsupported."
This is how S command work in QBASIC (quote):

~~~
Draw lines as specified by the given CommandString. The CommandString is created using commands from the Graphics Definition Language.
The start point for drawing can be defined using the PSET command. COLOR can be used to change the color of the lines.

Sn Determines the drawing scale by setting the length
of a unit of cursor movement. The default n is 4,
which is equivalent to 1 pixel.
## Graphics Definition Language

~~~
In the movement instructions below, n specifies a distance to move in pixel.

So this should work just fine:
| Command | Description
|---------| ---------
| Un | Move up.
| Dn | Move down.
| Ln | Move left.
| Rn | Move right.
| En | Move diagonally up and right.
| Fn | Move diagonally down and right.
| Gn | Move diagonally down and left.
| Hn | Move diagonally up and left.
| Mxy | Move to coordinate x,y. If x is preceded by a + or -, the movement is relative to the last point referenced.
| B | A prefix command. Next movement command moves but doesn't plot.
| N | A prefix command. Next movement command moves, but returns immediately to previous point.

~~~

DRAW "S8L10U50E25F25"
## Example 1: Let's draw a house

~~~

But apparently S command is unsupported.
```
COLOR 9
PSET 80,80
DRAW "R50D70L25U25L15D25NR15" ' House part 1
DRAW "L10U70E25F25" ' House part 2
PSET 118,105
COLOR 3
DRAW "R8U16L16D16R8U10NR8U6" ' Window
```