Hello
How easy is it to print out the standard Spectrum UDGs in BASIC?
It'd display a picture, say a logo, made up of the the UDGs (on the bottom line, above) and using DATA commands to control the UDGs.
Thanks.
Printing standard UDGs to screen
-
- Manic Miner
- Posts: 390
- Joined: Sun Nov 12, 2017 3:54 pm
Re: Printing standard UDGs to screen
Morning [mention]redballoon[/mention],
Assuming that you are referring to the 21 User Defined Graphics, it's easy. Please see this link to an example. Feel free to ask any questions.
viewtopic.php?p=48001#p48001
Edit. Just read your post again, to print those bottom characters just go into graphics mode, and print them as you normally would in a print statement.
You can also do print chr$(Number). You could store the numbers to print your artwork in an array and loop through it.
Sorry if I have the wrong end of the stick!
Assuming that you are referring to the 21 User Defined Graphics, it's easy. Please see this link to an example. Feel free to ask any questions.
viewtopic.php?p=48001#p48001
Edit. Just read your post again, to print those bottom characters just go into graphics mode, and print them as you normally would in a print statement.
You can also do print chr$(Number). You could store the numbers to print your artwork in an array and loop through it.
Sorry if I have the wrong end of the stick!
Re: Printing standard UDGs to screen
Do you mean an ascii art editor like playascii or rexpaint?
I begun a basic program which is meant to use kempston mouse from Basinc.
10 PRINT a$ : REM a$=one single string containing your asciiart made up of chr$ and custom font
I begun a basic program which is meant to use kempston mouse from Basinc.
10 PRINT a$ : REM a$=one single string containing your asciiart made up of chr$ and custom font
-
- Manic Miner
- Posts: 390
- Joined: Sun Nov 12, 2017 3:54 pm
Re: Printing standard UDGs to screen
Yeah, I think that's what I'm looking for.PeterJ wrote: ↑Tue Oct 13, 2020 8:36 am Morning [mention]redballoon[/mention],
Assuming that you are referring to the 21 User Defined Graphics, it's easy. Please see this link to an example. Feel free to ask any questions.
viewtopic.php?p=48001#p48001
Edit. Just read your post again, to print those bottom characters just go into graphics mode, and print them as you normally would in a print statement.
You can also do print chr$(Number). You could store the numbers to print your artwork in an array and loop through it.
Sorry if I have the wrong end of the stick!
Here's an example.
The type-in is like an Easter egg in that you've got this ZX basic and that above image is made up from the DATA, so you've no idea what you'll see until you type RUN. Obvs, the real image i'd like created is not the above example.
Re: Printing standard UDGs to screen
Yep, those aren't 'UDGs'', they're just fixed graphics characters. The UDGs are the ones you can redefine.
On a real Spectrum (or in an emulator), just start your PRINT AT Y , X ; " statement then press CAPS SHIFT+9 for 'Graphics Mode' (the cursor turns into a flashing G) then press the number keys 1..8 for the graphics blocks marked on those keys, or SHIFT+1..8 for the opposite versions. Note that the empty graphics block on key 8 is a different character code to a SPACE. You can also type A..U in Graphics Mode to get one of the 21 redefinable UDGs. press CAPS SHIFT+9 to go back to normal typing mode to finish off your PRINT statement with another ".
To do a coloured graphic like the one you've shown though, you'll have to change the PAPER colour every few characters.
(Actually, I think the number keys are marked wrong; they look like they show the opposite graphics character you only get with SHIFT).
On a real Spectrum (or in an emulator), just start your PRINT AT Y , X ; " statement then press CAPS SHIFT+9 for 'Graphics Mode' (the cursor turns into a flashing G) then press the number keys 1..8 for the graphics blocks marked on those keys, or SHIFT+1..8 for the opposite versions. Note that the empty graphics block on key 8 is a different character code to a SPACE. You can also type A..U in Graphics Mode to get one of the 21 redefinable UDGs. press CAPS SHIFT+9 to go back to normal typing mode to finish off your PRINT statement with another ".
To do a coloured graphic like the one you've shown though, you'll have to change the PAPER colour every few characters.
(Actually, I think the number keys are marked wrong; they look like they show the opposite graphics character you only get with SHIFT).
Re: Printing standard UDGs to screen
The Mojon Twins made a tool for that called BLOCKYGRAPHS
Take a look at this tutorial https://arcadespain.info/Foro/index.php?topic=7180.0
Take a look at this tutorial https://arcadespain.info/Foro/index.php?topic=7180.0
Re: Printing standard UDGs to screen
Code: Select all
10 READ row,col,ink,paper
20 PRINT AT row,col;
30 INK ink: PAPER paper
30 READ a
40 IF a=0 THEN GO TO 10
50 IF a=1 THEN STOP
60 PRINT CHR$ a;
70 GO TO 30
80 DATA 6,6,2,7,139,135,0
90 DATA 7,6,2,7,142,141,1
-
- Manic Miner
- Posts: 390
- Joined: Sun Nov 12, 2017 3:54 pm
Re: Printing standard UDGs to screen
Thanks [mention]MonkZy[/mention] that looks just what I’m look for! Il give that a try later and let you know how I got in! Thanks again.