Howdy Y'all, I need help changing the color of an individual letter/character. I'm not sure if this is possible, as I was totally unable to find anything on this forum at all, or on the C64 Wiki.
This is my little lame code, I'm trying to make a text adventure thing.
This is what it looks like after running the list. I have some things as an example of what characters I'd like changed.
Obviously, you can see labeled with pink box/arrow.
This I what I want changed. I'd like to have it grey like the line I typed across the screen.
It might be really late and I'll have to check this thread tomorrow, but I need help with this. Hopefully someone's up to respond to this garb.
Also, excuse me if I broke any rules. I made this account just now to post this thread. That, and thank you all.
How to change the color of an individual character?
-
- Member
- Posts: 2
- Joined: Sun Apr 01, 2018 9:35 am
- Contact:
Re: How to change the color of an individual character?
The simplest way is to use the control codes inside the quotation marks.
So you type the line as PRINT, then SHIFT+2 to open quotes then press CTRL and a number key 1-8 or COMMODORE and 1-8 to get a colour. Onscreen you will see a reversed symbol. But when the program runs it will change the cursor colour and print the characters in that colour.
You can have multiple colour changes in a line, as long as the BASIC line is less than 80 characters.
So to get that grey colour you would press COMMODORE and 4 inside the quotes.
The colour names are printed on the side of the keys.
So you type the line as PRINT, then SHIFT+2 to open quotes then press CTRL and a number key 1-8 or COMMODORE and 1-8 to get a colour. Onscreen you will see a reversed symbol. But when the program runs it will change the cursor colour and print the characters in that colour.
You can have multiple colour changes in a line, as long as the BASIC line is less than 80 characters.
So to get that grey colour you would press COMMODORE and 4 inside the quotes.
The colour names are printed on the side of the keys.
-
- Member
- Posts: 2
- Joined: Sun Apr 01, 2018 9:35 am
- Contact:
Re: How to change the color of an individual character?
I'll probably just give up. I cant change the color while editing text, and I'm unable to change the color permanently by pressing enter on the line of code after changing its color.
Re: How to change the color of an individual character?
I am completely baffled by your reaction. Changing the color of text on the VIC-20 and C64 is an incredibly simple thing to do.FridtjofBjarturson wrote: ↑Sun Apr 01, 2018 1:34 pm I'll probably just give up. I cant change the color while editing text, and I'm unable to change the color permanently by pressing enter on the line of code after changing its color.
Using POKE646,x is probably to most cryptic approach. There is a reason why you see BLK, WHT, RED and other color names on the numbers 1 to 8 on the VIC-20 and C64 keyboard and that's because pressing CTRL with one of these numbers changes the following characters to the chosen colors.
Specifically on the C64, pressing the Commodore key (lower left corner of the keyboard) and a number from 1 to 8 gives you an additional 8 colors.
You can also use CHR$ codes listed on page 141 of the original C64 user manual.
Try Something like:
Code: Select all
10 PRINT CHR$(30);"MY NAME IS";CHR$(28);" FRANCOIS";CHR$(158);" LEVEILLE"
5 - White
28 - Red
30- Green
31- Blue
129- Orange
144- Black
149- Brown
150- Light Red
151- Dark Gray
152- Gray
153- Light Green
154- Light Blue
155- Light Gray
156- Purple
158- Yellow
159- Cyan
The easiest way remains pressing CTRL or C= with the quote mode activated as stated in the previous post by merman.
Socialism never took root in America because the poor see themselves not as an exploited proletariat but as temporarily embarrassed millionaires. -John Steinbeck
- Gyro Gearloose
- Member
- Posts: 471
- Joined: Sun Nov 15, 2015 5:20 am
- Contact:
Re: How to change the color of an individual character?
Calm down. You have to RUN the code. You are using "print" codes, they don't actually change the color RIGHT THERE, they work when the string in quotes is printed back by the BASIC interpreter when running the code.FridtjofBjarturson wrote: ↑Sun Apr 01, 2018 1:34 pm I'll probably just give up. I cant change the color while editing text, and I'm unable to change the color permanently by pressing enter on the line of code after changing its color.
The price one pays for pursuing any profession, or calling, is an intimate knowledge of its ugly side.
- Gyro Gearloose
- Member
- Posts: 471
- Joined: Sun Nov 15, 2015 5:20 am
- Contact:
Re: How to change the color of an individual character?
So was this just an April Fool's?
The price one pays for pursuing any profession, or calling, is an intimate knowledge of its ugly side.
Who is online
Users browsing this forum: No registered users and 5 guests