Lately, I've been working on a program to create text sprites (I noticed it was quite a tedious process which could definitely be automated). I started out with Kerm's DCSICON program (to create icons for DoorsCS on-calc). Anyway so I grabbed the drawing part and also his main menu and started modifying them to fit my needs. This way, the drawing part is fairly similar to DCSICON, and I'm assuming people are pretty familiar with it. basically, the program, instead of creating hex code to display as an icon, it creates the code to display the drawing as a horizontal text sprite to be used in other people's programs. It is made in pure ti-basic for the monochrome 8x calcs so you don't need any additional files on your calculator to use it, since well, people who use text sprites are devoted pure basic programmers Razz It does however have an icon for DoorsCS in case you do intend to run it from that shell.
Here is the main menu screen, the text sprite was of course created using the program itself, but besides that, it's a pretty basic menu.

After clicking create, you will then be able to draw, again, pretty basic, the keys used are explained in the help section and in the readme.

Then you draw...

Once you're done drawing, press enter, the program will then go ahead and check the pixels and create the text sprite. It has both horizontal and vertical checking so that you can create sprites that are smaller than the square and have the sprite be proportionately smaller as well. This checking is done from right to left and from bottom to top, so to get the best speed out of your text sprite, you should draw from the top left corner, but drawing anywhere will work. The code it will give out is different if the sprite is 5 pixels or less in height and is placed at the top left, since you only need 1 For( loop to display this kind of sprite #Optimization. Once the program will be done creating the code (this should take about 20-30 seconds), text will show up indicating it is done.

Then you recall Str2 in your program and this code shows up. (I switched to jstified simply because I wanted screenies from the program editor)

The only sad part of the program is that it can't put quotation marks in the string, so you will have to add those yourself (in the sub( command ). You will also obviously have to remove the ones left behind by recalling the string. Here is what the code is supposed to look like after you've done this.

ANNNDDD you're done!
running this code will display the sprite!

The file is available for download here in the cemetech archives
https://www.cemetech.net/programs/index.php?mode=file&id=1341
Awesome! Just something: how might you recall the string to display its arguments in the prkgram editor?
Wow, good idea actually. I always wondered if such program existed. I later discovered that it has already made before, but unfortunately the said program was in the now-defunct United-TI archives.

I am curious if it could be altered a bit to work with the 84+CE?
Awesome! You should make it so that the first thing in the code it generates is ClrDraw though. When I ran it, the "RECALL Str2..." text was still on the graph screen.

Also, please put the download link in your post Smile
Good work. I have been looking for such a program earlier and didn't find one. Then I was too lazy to make one by myself and so I have no help at doing text sprites. Thank you!
But I'd recommend putting only the string data in Str2 - a Basic programmer using text sprites is supposed to know how to use them. Also this would save you from looking where to remove and where to put the quotes.

And by the way, where do we find this program? Could you add a link please?
Unicorn wrote:
Awesome! Just something: how might you recall the string to display its arguments in the prkgram editor?

2nd STO VARS 7 2
DJ_O wrote:
Wow, good idea actually. I always wondered if such program existed. I later discovered that it has already made before, but unfortunately the said program was in the now-defunct United-TI archives.

I am curious if it could be altered a bit to work with the 84+CE?

I don't own a CE, but I believe text sprites are different on there because there is some blank space drawn around text (Maybe I'm wrong tho) I'll look into this, maybe even port it to the CSE and CE someday Smile
Nik wrote:
Good work. I have been looking for such a program earlier and didn't find one. Then I was too lazy to make one by myself and so I have no help at doing text sprites. Thank you!
But I'd recommend putting only the string data in Str2 - a Basic programmer using text sprites is supposed to know how to use them. Also this would save you from looking where to remove and where to put the quotes.

And by the way, where do we find this program? Could you add a link please?

At first, the program only stored the string data to Str2, but the user would then have to know how many blocks of 5 his sprite was, and the length of the string and whatever to create the for( loops around it and all that. I figured that part could be automated as well, Makes the job easier for everyone because, well that's what this program was meant to do Wink
Michael2_3B wrote:
Awesome! You should make it so that the first thing in the code it generates is ClrDraw though. When I ran it, the "RECALL Str2..." text was still on the graph screen.

Also, please put the download link in your post Smile

You're supposed to recall Str2 inside a program... That text shouldn't be on the graph screen at any point... And I didn't put a ClrDraw because the code is for use in a program, would be pretty lame to have the other stuff that was displayed disappear when you draw a text sprite, The text sprite on the menu screen was made with the program itself to show how it could be used Razz


Added the download link Smile
I understand you...
I do not have the possibility to test it now, but I have a question: How do you handle those cases when there is no character to fit for some row of pixels? If it isn't done yet like this, I'd recommend adding a few PxlOn commands to Str2...
Nik wrote:
I understand you...
I do not have the possibility to test it now, but I have a question: How do you handle those cases when there is no character to fit for some row of pixels? If it isn't done yet like this, I'd recommend adding a few PxlOn commands to Str2...

The beauty of horizontal text sprites is that there is a character for every single combination of pixels on-off except one combination, 01011, so if there is that combination in your sprite, I didn't mess around with pxl-on commands (adding an if statement to the loop that finds the correct characters would considerably slow down the program) instead, I just pretended it was 01010, which is a : symbol, so if that combination of pixels shows up, one pixel that is supposed to be on will be off, but I figured that's not a big deal. this is not the case with vertical text sprites, in which lots of combinations don't have a character that can display them, so even though vertical text sprites are faster to display, making a program to display those would either heavily mess up your drawing, or would be such a pain to try to code that I decided to stick with just horizontal ones.
I think michael was mentioning that you should put a ClrDraw at the end of your program to rememove any leftover text. Wink
mrwompwomp, as tibasicdev says, you can generate any combination of pixels with vertical sprites:

Quote:
...you can make any vertical sprite using only the ., [, and the ∟.


Vertical sprites also have the advantage of increased speed and the cost that you can't draw on the top of the screen.
lirtosiast wrote:
mrwompwomp, as tibasicdev says, you can generate any combination of pixels with vertical sprites:

Quote:
...you can make any vertical sprite using only the ., [, and the ∟.


Vertical sprites also have the advantage of increased speed and the cost that you can't draw on the top of the screen.

I haven't done much vertical sprites, sowwy Razz but if they say it's possible, I will definitely consider trying to expand the program to create those as well, thanks for pointing that out, I'll get around to learning how to do it soon enough Smile
Quick edit, while it is true that you can make any vertical text sprite using those few characters, it would be even faster to use the larger characters (up to like 6 pixels wide), and that's what would be hard to code, since each line would have to have the same amount of characters but not every character has the same width. I haven't experimented with this enough, but does anyone know if the speed difference would be considerable if I were to only use 3 pixel wide characters?
It wouldn't be possible as most characters take exactly 3 pixels in width and one line is empty to delimit them, also they have chracters like "t", "l"and "(" that are high and others like "m", "n" and "o" that are low. So you will have a really small range of possibilties.
At least if I understood correctly and you want to use tokens.
Nik wrote:
It wouldn't be possible as most characters take exactly 3 pixels in width and one line is empty to delimit them, also they have chracters like "t", "l"and "(" that are high and others like "m", "n" and "o" that are low. So you will have a really small range of possibilties.
At least if I understood correctly and you want to use tokens.

Well no, in the small font used when displaying text (if you don't put a -1 as the first argument of a text( command), the different characters take all kinds of sizes, for example, the . is only 1 pixel wide, while the [ is 3 pixels wide, and the m is 5. But in general, you're right that lots of the characters are 3 pixels wide.
Vertical text sprites are drawn from bottom to top (top to bottom would cause the line above to be erased anyway), so the height difference of characters is not detrimental.

Space, ., [, and ∟ can indeed form any sprite. Space is 0, . is 10, [ is 110, and ∟ is 111, so one of them will always fit the next few pixel values in your sprite. There are actually very few useful tokens, according to tibasicdev, of five or more pixels, because most of them are two bytes (or not even tokens) and can therefore be replaced by two small tokens. So vertical text sprites generally take more space than horizontal.
mr womp womp wrote:
DJ_O wrote:
Wow, good idea actually. I always wondered if such program existed. I later discovered that it has already made before, but unfortunately the said program was in the now-defunct United-TI archives.

I am curious if it could be altered a bit to work with the 84+CE?

I don't own a CE, but I believe text sprites are different on there because there is some blank space drawn around text (Maybe I'm wrong tho) I'll look into this, maybe even port it to the CSE and CE someday Smile
There's some space below characters, but not on the sides, so text sprites will still work, but each row will be separated by a few pixels.

EDIT: Example of what I mean in a screen capture of Bejeweled by JWinslow23 after some modifying.

So I guess a port of this would b very nice! I want to create some programs that are crosscompatible, and look good. Smile
Unicorn wrote:
So I guess a port of this would b very nice! I want to create some programs that are crosscompatible, and look good. Smile

Yeah I think that's the main drawback with libs, it's that they aren't cross compatible whatsoever...(And you need extra files on your calc to be able to run programs who utilize these xD) Although text sprites aren't DIRECTLY cross compatible either... (between monochrome and color calcs) So you would prolly need to change those up and create two version of your program. One for each type of calculator...
Yeah, in general it's due to the fonts being twice larger and stuff like that, as well as the screen. You have to multiply each text sprite chunk coordinate by 200% and other stuff like that and some fonts will obviously look different in text sprite form.
I actually meant cross compatible between the CE AND CSE, not the monochromes Wink
If you recall u instead of Str2, there will be no quotation mark at the start.
  
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 2
» 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