Nice. Oh yes, I know those well, Steve. My dad was a CPA and did everything old-school. Have boxes of old big ledgers and accounting paper still.
I should have stayed home and played with QB64 more - went to work and the gig was called off. The program director waited until I carried in all my music gear before coming in to tell me. While I was driving home I thought to make the spiral paper look better. Made the coil thicker and gave the paper a rounded edge.
(My friend will be surprised how his little paper request got all this attention here. lol.)
- Dav
I should have stayed home and played with QB64 more - went to work and the gig was called off. The program director waited until I carried in all my music gear before coming in to tell me. While I was driving home I thought to make the spiral paper look better. Made the coil thicker and gave the paper a rounded edge.
(My friend will be surprised how his little paper request got all this attention here. lol.)
- Dav
Code: (Select All)
'notebookpapers2b.bas
'yellow, white & spiral background notebook paper.
'by Dav, OCT/2023
Screen _NewImage(800, 600, 32)
'Here's where you can load another font you want to use....
'fnt& = _LoadFont("lucon.ttf", 24, "monospace")
'_Font fnt&
'Call the SUB, with your title$ message
'YellowPaper "John's QB64-PE Code Notebook" '<< this one for yellow paper
'WhitePaper "John's QB64-PE Code Notebook" '<< this one for white paper
SpiralPaper "John's Spiral Notebook" '<< use this one for spiral paper
Sleep
End
'You need to call below so PRINTing text doesn't destroy background.
_PrintMode _KeepBackground
'=== show some sample information....
Color _RGB(64, 64, 64)
For y = 5 To 16
Locate y, 2: Print Date$;
Locate , 16: Print "Random Data ="; Rnd; RN;
Next: Print
'Use location 2 to print in left column, 16 for printing in the text lines.
Print
Locate , 16: Print "This is another line."
Print
Locate , 2: Print "Tuesday:"
Locate , 16: Print "Dear diary, today I wrote this...."
Sleep
Sub YellowPaper (title$)
'This SUB draws yellow notebook paper, scaled to fit current font settings.
'It also prints and centers title$ in the top title area.
fw = _FontWidth: fh = _FontHeight 'get current font width/height settings
'(the fw & fh we will use to calculate LINE drawing so they line up right with PRINT)
Cls , _RGB(255, 245, 154) 'clear screen to yellow color
'draw the two vertical brown lines, to make column/text area
Line (fw * 12, 0)-(fw * 12, _Height), _RGB(205, 185, 98)
Line (fw * 12.5, 0)-(fw * 12.5, _Height), _RGB(205, 185, 98)
'draw the text lines to bottom of screen
For y = fh - 1 To _Height Step fh
Line (0, y)-(_Width, y), _RGB(152, 160, 74)
Next
If title$ <> "" Then
'draw top brown tile area (remove this if not wanted)
Line (0, 0)-(_Width, fh * 3), _RGB(102, 19, 15), BF '<< enough for 3 lines
Color _RGB(255, 255, 0), _RGB(102, 19, 15)
'Next we print title$, centering the text in the top area
'For this we need to calcuale how many letters fit on one line, INT(_WIDTH/fw) / 2.
'I divided that by 2 to find the center spot on the line.
'So, subtract half of the title$ length from that spot to make it centered nice.
Locate 2, Int((_Width / fw) / 2) - Int(Len(title$) / 2)
Print title$; 'finally, PRINT the title$
End If
End Sub
Sub WhitePaper (title$)
'This SUB draws white notebook paper, scaled to fit current font settings.
fw = _FontWidth: fh = _FontHeight 'get current font width/height settings
'(the fw & fh we will use to calculate LINE drawing so they line up right with PRINT)
Cls , _RGB(240, 240, 240) 'clear screen to white color
'draw three holes
Circle (fw * 8, fh * 8), fw * 2, _RGB(210, 210, 210)
Paint (fw * 8 + 1, fh * 8 - 1), _RGB(210, 210, 210)
Circle (fw * 8, fh * 20), fw * 2, _RGB(210, 210, 210)
Paint (fw * 8 + 1, fh * 20 - 1), _RGB(210, 210, 210)
Circle (fw * 8, fh * 32), fw * 2, _RGB(210, 210, 210)
Paint (fw * 8 + 1, fh * 32 - 1), _RGB(210, 210, 210)
'draw the vertical line, to make column/text area
Line (fw * 12, 0)-(fw * 12, _Height), _RGB(219, 135, 151)
'draw the text lines to bottom of screen
For y = fh * 5 To _Height Step fh
Line (0, y)-(_Width, y), _RGB(139, 179, 204)
Next
If title$ <> "" Then
'Next we print title$, centering the text in the top area
'For this we need to calcuale how many letters fit on one line, INT(_WIDTH/fw) / 2.
'I divided that by 2 to find the center spot on the line.
'So, subtract half of the title$ length from that spot to make it centered nice.
Locate 2, Int((_Width / fw) / 2) - Int(Len(title$) / 2)
Color _RGB(0, 0, 0), _RGB(240, 240, 240)
Print title$; 'finally, PRINT the title$
End If
End Sub
Sub SpiralPaper (title$)
'This SUB draws spiral white notebook paper, scaled to fit current font settings.
fw = _FontWidth: fh = _FontHeight 'get current font width/height settings
'(the fw & fh we will use to calculate LINE drawing so they line up right with PRINT)
Cls , _RGB(32, 32, 32)
'round right corner
Circle (_Width - (fw * 4), fh), fw * 2, _RGB(240, 240, 240)
Paint (_Width - (fw * 4) + 1, fh - 1), _RGB(240, 240, 240)
'paper
Line (fw * 3.5, 0)-(_Width - fw * 4, fh * 4), _RGB(240, 240, 240), BF
Line (fw * 3.5, fh)-(_Width - fw * 2, _Height), _RGB(240, 240, 240), BF
For y = 0 To _Height Step fh
Circle (fw * 4, y), fw * 2, _RGB(164, 164, 164), .6, _Pi * 1.4
Circle (fw * 4 + 1, y + 1), fw * 2, _RGB(132, 132, 132), .6, _Pi * 1.4
Circle (fw * 4 + 2, y + 2), fw * 2, _RGB(100, 100, 100), .6, _Pi * 1.4
Circle (fw * 4 + 3, y + 3), fw * 2, _RGB(100, 100, 100), .6, _Pi * 1.4
Circle (fw * 5.6, y + (fh / 3)), fw / 2, _RGB(0, 0, 0)
Paint (fw * 5.6 + 2, y + (fh / 3) - 2), _RGB(0, 0, 0)
Next
'draw the vertical line, to make column/text area
Line (fw * 16, 0)-(fw * 16, _Height), _RGB(219, 135, 151)
'draw the text lines to bottom of screen
For y = fh * 5 To _Height Step fh
Line (fw * 3.5, y)-(_Width - (fw * 2), y), _RGB(139, 179, 204)
Next
If title$ <> "" Then
'Next we print title$, centering the text in the top area
'For this we need to calcuale how many letters fit on one line, INT(_WIDTH/fw) / 2.
'I divided that by 2 to find the center spot on the line.
'So, subtract half of the title$ length from that spot to make it centered nice.
Locate 2, Int((_Width / fw) / 2) - Int(Len(title$) / 2) + 4 '<< added 4 for spiral offset
Color _RGB(0, 0, 0), _RGB(240, 240, 240)
Print title$; 'finally, PRINT the title$
End If
End Sub