Help with getting started with graphics and touchscreens... where to start?
vanmunch
Posts: 568
Hey everyone,
I recently purchased a couple of Rayman's excellent 4.3 inch touchscreens and got his demo programs running on then within 20 minutes of opening the box. Now I'm trying to figure out how to modify the code so that I can change the background and font colors, draw buttons/ graphics, and have it recognizes when one of the buttons have been pushed. The part that really has me stumped is with the graphic/color stuff and there codes. I've found the "Character Chart", but I can't find anything that helps with the colors or being able to change the background/font colors. I've already read through the massive "4.3" Touchscreen Thread Consolidation Test" thread (condensed version found here: http://forums.parallax.com/showthread.php?132083) Any help would be great. I feel like there is a great "Intro to using your touch screen and how to change the graphics" out there, but I'm just not looking in the right spot....?
Dave
I recently purchased a couple of Rayman's excellent 4.3 inch touchscreens and got his demo programs running on then within 20 minutes of opening the box. Now I'm trying to figure out how to modify the code so that I can change the background and font colors, draw buttons/ graphics, and have it recognizes when one of the buttons have been pushed. The part that really has me stumped is with the graphic/color stuff and there codes. I've found the "Character Chart", but I can't find anything that helps with the colors or being able to change the background/font colors. I've already read through the massive "4.3" Touchscreen Thread Consolidation Test" thread (condensed version found here: http://forums.parallax.com/showthread.php?132083) Any help would be great. I feel like there is a great "Intro to using your touch screen and how to change the graphics" out there, but I'm just not looking in the right spot....?
Dave
Comments
I have some poorly written and documented code for those touch screens. It can detect vertical and horizontal slides, scroll through a row of buttons with the slide, detect single and double clicks and so on. If you don't get a better offer, contact me off list at: jpeakall AT madlabs DOT info.
But if yer lucky, someone will have some better code. Heck, I'd like some better code too! :-)
Jonathan
The colors work exactly the same way...
Somewhere in the main Spin program you should have this:
The first two longs there define the default foreground and background color (text color #0).
This is also the background color when the screen is cleared.
Hey Ray, I found that and tried chanding the values, but it was just a mess. I was hoping that there was a kind of a color key such as "This color is" $08A808A8
I found the below key, but I don't understand how those codes are used to create the ones in the program. Any help would be great!
Dave
Color64_B.gif@
So $F00C is 11110000_00001100. Color 0 is 00 red, 00 green, 11 blue; color 1 is 11 red, 11 green, 00 blue. You have yellow pixels on blue background.
This is a piece of code from my vga driver:
There's an applet here for deciphering/encoding the colors:
http://www.rayslogic.com/propeller/Programming/Colors.htm
under the applet is info on the format for text mode...
Thanks for your help and info. I feel like I'm starting to make some real progress. The explination of the how the colors are coded is great and Ray's applet is wonderful. I've been able to change the background and text colors to whatever I want. Such as black and white using $FC00FC00 and then $FCFC0000 (incase any lurkers are trying to figure out the same thing ) Now that I can change the colors, I'm going to go and start working on figureing out the other stuff...
Never got an email, just so ya know.
Jonathan
opps, sent it to .com by accident
If your feeling brave, you can also try VisualSpin with that 4.3" touchscreen.
It can help you quickly make a GUI. But, there's no help file or instructions...
@Ray I've never used VisualSpin before, sounds like something else I need to try.
Thanks again for everyone's help!
Dave