I'm trying to create a Minesweeper game on my TI-84 plus CE using draw functions. When the user reveals a tile, I would like that tile to be shaded for aesthetic purposes, so I use the Text( command to fill the tile grey. However, when I use Text( again to output the number of surrounding mines to the grey tile, the number is highlighted in white, an example shown in the picture. I know I can fill each white pixel by using pxl-test(, but that is quite slow. Is there a fast way to fill in the white highlight, or to turn that off?


Thank you
Sorry, you need to either change your background, or use an ASM library to get the background to match. I think TextLib is the library you're looking for. You may want to look at this site for more text color information.
I thought TextLib only has homescreen functions...
Also, changing the TextColor() won't get rid of the white border.

Sprites by grosged might be what you are looking for. It would allow you to display text with arbitrary foreground and background colors without having to learn ICE, asm or C, but it won't sing kumbaya with the graphscreen, so using it would require changing up the display part of your game entirely to all use the sprite functions. Doing so would have the added benefit of allowing you to use the entire screen rather than just the graphing area, which could be nice for a minesweeper game. If you chose to use Sprites, you will have to be careful to set it up before and after using the graphic commands to prevent ending up with some unwanted junk on the screen and to prevent the player from exiting while still being stuck in 8bpp mode.
Here is an example of how to use the libs. I would recommend shortening the names of the programs if you intend on using them extensively, but for the sake of simplicity, I didn't change them.

Code:
Asm(prgmSETTINGS
255:Asm(prgmCLSCREEN
{5,5,224,7:Asm(prgmPRINT
"TEST:Asm(prgmPRINT
Pause
Asm(prgmBACKHOME

Asm(prgmSETTINGS initializes stuff and switches to 8bpp mode.
255:Asm(prgmCLSCREEN sets the background to white (255 in 256 color mode).
{5,5,224,7:Asm(prgmPRINT is the settings for the PRINT command (coordinates 5,5, red foreground, green background).
"TEST:Asm(prgmPRINT prints the string "TEST" using the settings defined above.
Pause I don't need to explain what pause does...
Asm(prgmBACKHOME redraws the status bar, returns to 16bpp, and probably does some other cleaning up.
mr womp womp wrote:
I thought TextLib only has homescreen functions...
Also, changing the TextColor() won't get rid of the white border.

Sprites by grosged might be what you are looking for. It would allow you to display text with arbitrary foreground and background colors without having to learn ICE, asm or C, but it won't sing kumbaya with the graphscreen, so using it would require changing up the display part of your game entirely to all use the sprite functions. Doing so would have the added benefit of allowing you to use the entire screen rather than just the graphing area, which could be nice for a minesweeper game. If you chose to use Sprites, you will have to be careful to set it up before and after using the graphic commands to prevent ending up with some unwanted junk on the screen and to prevent the player from exiting while still being stuck in 8bpp mode.
Here is an example of how to use the libs. I would recommend shortening the names of the programs if you intend on using them extensively, but for the sake of simplicity, I didn't change them.

Code:
Asm(prgmSETTINGS
255:Asm(prgmCLSCREEN
{5,5,224,7:Asm(prgmPRINT
"TEST:Asm(prgmPRINT
Pause
Asm(prgmBACKHOME

Asm(prgmSETTINGS initializes stuff and switches to 8bpp mode.
255:Asm(prgmCLSCREEN sets the background to white (255 in 256 color mode).
{5,5,224,7:Asm(prgmPRINT is the settings for the PRINT command (coordinates 5,5, red foreground, green background).
"TEST:Asm(prgmPRINT prints the string "TEST" using the settings defined above.
Pause I don't need to explain what pause does...
Asm(prgmBACKHOME redraws the status bar, returns to 16bpp, and probably does some other cleaning up.


With that program you could also make actual sprites too! Evil or Very Mad
I can give you code, but I'm short for time rn
That's why I recommended it Wink
Thanks for your help! I actually learned ICE, so I guess this is no longer a problem.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement