Omnimaga
Calculator Community => TI Calculators => TI-BASIC => Topic started by: ztrumpet on February 02, 2010, 05:37:05 pm
-
Vertical Text Sprites are a really great way to display large sprites on the screen. I use this method for displaying the main menu graphic in Elmgon. (This screenie is shown below, but those who have seen my first post my Elmgon topic have sceen it.)
The idea behind vertical text sprites is to keep the bottom row of text of the text command before it. You can see that with this code:
:Text(3,0,".... //4 periods
:Text(2,0," //7 spaces
:Text(1,0,". . //Period, 4 spaces, period
:Text(0,0," ... //Space 3 periods
Now after you've sceen this (This next part is for 84 users only) press Mode and run the code again. Suddenly the bottom row dosn't show up. This is because the Ti-OS has set a flag, and displaying any table (matrix editor or 2nd graph) will reset the flag. You can reset the flag in basic:
:G-T
:DispGraph
:Full
The main characters used are the period (10) space (0) List L (111) and Left Bracket (110). By using these and other combinations you can make any sprite. (except for the 3 right most pixels and top 6 pixels) This is a lot bigger than RecallPic and slower, but because it dosn't use a Pic var, it's worth it.
A program and screenie of the program are included. The program will not optomize, like 4 spaces becoming ^ for example. You can use this link http://weregoose.unitedti.org/bottomrow/ (The link is now dead, so try here (http://tifreakware.net/tutorials/83p/b/misc/ztrumpetsverticaltextsprite.htm#list), here (http://ourl.ca/4059/227564), or here (http://ourl.ca/4059/227572) instead.) to find the bottom row for every token. (It is worth noting that the List L and Finance N do not have buffer spaces at thier ends in the small font.)
More info:
http://tibasicdev.wikidot.com/textsprites#toc3
Enjoy. (The program takes the row you want and encodes it, as you can see in the screenie.)
Edit: After I wrote this, TI released OS 2.53 MP. It messes with the flag so you can't reset it with G-T. Instead, you must use a small Asm program with this hex code: FDCB058EC9 However, on the old (read: better) OSes you can use G-T. :)
Good luck with this great technique! ^-^
(http://www.omnimaga.org/index.php?action=dlattach;topic=1462.0;attach=629;image)
(http://www.omnimaga.org/index.php?action=dlattach;topic=1462.0;attach=631;image)
prgmVRTXTSPR (http://www.omnimaga.org/index.php?action=dlattach;topic=1462.0;attach=630)
-
It's so fasinating how much you can do with Ti-Basic. Good work
-
I didn't know this technique. I only knew the Normal Horizontal Sprites with text...
I also didn't know that page in Weregoose site. It would be cool someone coded a utility to take a sprite or screen and convert to vertical text sprites...
-
I also didn't know that page in Weregoose site. It would be cool someone coded a utility to take a sprite or screen and convert to vertical text sprites...
If you're refering to opmtomized, then yes. That would be incredibly cool!
(If you mean not opromized, check the attachment above that isn't a screenie. :) )
-
I always loved how you display your title screen, altough I myself just don't get how it works x.x. I am amazed at what basic programmers can do these days
-
Yay vertical text sprites! They are much faster than the horizontal variety :) I think you tradeoff in speed tho O.o Great info nonetheless!!
-
I think I recall seeing a RPG from someone either on Omni or UTI that used horizontal text sprites once and it was quite slow indeed. It looked pretty cool, though.
-
Donut Quest, The best puzzle game in the world, is my favorite example of horizontal text sprites ^^
They can be slow though, and care needs to be taken that it doesnt slow your game down :P
-
I didn't try this one yet, even thought it's supposedly good, because for some reasons it still seems to bring me bad memories from stuff that happened on UTI before (with Darkerline and some others, altough I won't go into details) :/
I really need to check it, though, one day, cuz I am kinda curious and would like to see.
-
Donut Quest was my favorite calc game, untill I found Illusiat 13. :D
-
For a while I never understood the whole hype about Donut Quest. I always wondered what so special about this game and why it was so popular, but until like this summer, I thought it was only for 68k calculators. Now I still wonder about the popularity, so I think I'm definitively gonna try it now, cuz I'm really wondering what's so special about it. Again it might be hard for me to notice even after I play, because I do not like puzzle games as much as RPGs and action games
EDIT: I guess the game is not that bad and is a good example of horizontal sprites, but I didn't continue far because I can't even solve the first puzzle (no way to pick the keys to the right, cuz there's no space to go behind them to push them to the left)
-
Oh yeah that is a tricky puzzle :) it is possible to get one key but it is a bit tricky. It's not for everybody, especially if you don't like puzzle games
-
It's my one of favorite games because it's so hard. DJ, there is a way, but it takes about 30 minutes to figure out (or did for me). I was stuck on the 7th ( of 8 ) level for 2-3 months before I beat it. The whole game took me about 6 months. ;D
Builderboy, you loved that puzzle (the key one) so much it's in Trapped. O0
-
Haha you noticed that one? ;D yeah it's true, Donut quest is my hero ^^
-
On a related topic, what would you use for columns for horizontal text sprites that don't have a 3x5 token starting with that column? For example, what if you had a text sprite that absolutely had to have a column of 11001?
-
then you are either out of luck, or you would have to use some sort of trickery to first make the sprite with or without a critical pixel and then switch it on or off afterwards, if that makes sense
-
Update:
If appears that weregoose's site is down right now, so I'm putting a copy of his table in the post so it doesn't get lost to time.
-
O my god!
What's this? :o :o :o
-
O my god!
What's this? :o :o :o
This is a ridiculous way of doing graphics in TI Basic. :P
-
And how to use this in a program?
I have no idea how to insert something like this in a code.
And for what can I use it?
Text?
-
I've converted it into pdf, but idk if all came out right, since it gave me some errors while making it...
I'm guessing some fonts are not displayable or something :/
And for what can I use it?
Text?
This is used for graphics, mostly for filling up the whole screen or drawing a large sprite :)
Edit: Since this laptop's adobe thingy is in korean, it kept throwing error for non-korean adobes. So I've just attached htm file
-
It tells me that i need a KOREAN FONT for watching the .pdf
There's no text shown in the .pdf :(
-
damn, stupid laptop... let me see if I can fix that
Edited the above post
-
Update:
If appears that weregoose's site is down right now, so I'm putting a copy of his table in the post so it doesn't get lost to time.
weregoose.unitedti.org has been removed entirely :(
-
Tifreak uploaded this tutorial to TiFreakware, and it includes the best version of the table to date:
http://tifreakware.net/tutorials/83p/b/misc/ztrumpetsverticaltextsprite.htm#list
-
That be a huge table O.O
-
I have a question... can one use this method to draw sprites in the top 6 pixels, or do you need horizontal sprites for that?
EDIT:
And yes, I know I necroposted :P
-
The reason you can't do top six is because there's always a clear top row for graphscreen text (with the exception of accented chars). On the other hand, it should work with Text(-1 ... wonder if anyone's tried that yet.
-
Hmm, but that doesn't allow the user to go offscreen, right?
-
The reason you can't do top six is because there's always a clear top row for graphscreen text (with the exception of accented chars). On the other hand, it should work with Text(-1 ... wonder if anyone's tried that yet.
It wouldn't because there's always a row of white pixels at the bottom of those sprites. However, you could probably make it work top down:
-
But then you cannot get the bottom rows, right?
-
But then you cannot get the bottom rows, right?
Right. There's drawbacks to every single type of text sprites for this reason.
-
How do you store a lot of rows for vertical text sprites? Would you store those rows to a string separated by something like "000, 001, etc?"
Edit: I found this (http://tibasicdev.wikidot.com/numerically-index-words).
-
or you can just hardcode it.
Text(56,0,"1ST ROW STRING
Text(55,0,"2ND ROW STRING
Text(54,0,"3RD ROW STRING
etc.
-
That would take too much memory. We have only 24KB of RAM on our calcs.
-
But it can be more efficient if you're not using it very much.
EDIT: At least, faster than For loops
-
I think storing all the rows in a string will take more RAM out, whereas my method you don't even use the string at all. Also speed-wise, it will be faster.
-
I think storing all the rows in a string will take more RAM out, whereas my method you don't even use the string at all. Also speed-wise, it will be faster.
That is correct, because if you store them in a string, and use the string to display them, that means your string is first being stored in your program, and it is also being stored in the string variable! That means you would be using double the amount of memory by using strings, although that isn't 100% accurate because it also adds a bit of memory when you repeat the Text() commands
-
Let's see.
57 lines...
One picture takes 767 bytes+5 per call
Big string=1+57(3)+sigma(An,n,6,62) (typical 40, say?)+1+1 (for) + 1 (i) + 1 +1+1 +1 +1 + 80? +1=2541
Hard coded=57(1+1+1+1+1+1+40)+5+57=2684
Tip: Using a picture variable saves memory.
-
Well I don't think anybody is saying that these methods will take less memory than a picture variable :P And I believe the reason that these methods are used is to that all of your data resides within the program, and you don't have multiple files needed to run your game. This becomes even more important because there are only 10 picture variables, and if you have two games that each use the same variable, you're going to have a bad time D:
-
Also, if your data go aver a 1 picture variable just a bit, you'll end up using 2 picture vars with one of them having a lot of useless space. D:
-
And also, you don't have to store the big string into a variable. You can store it in Ans. And, if much of the RAM is used on a game, the picture variable is preferable.
-
And, if much of the RAM is used on a game, the picture variable is preferable.
Preferable by some that is. I myself find it difficult to play *any* games that use picture variables, simply because I already have a bunch of picture variables archived on my calc that are used as sprite sheets for many of my Axe games.
-
And, if much of the RAM is used on a game, the picture variable is preferable.
Preferable by some that is. I myself find it difficult to play *any* games that use picture variables, simply because I already have a bunch of picture variables archived on my calc that are used as sprite sheets for many of my Axe games.
^
I just wish that TI-BASIC lets me use appvar.
-
Also I was planning to use this method to make up a picture of different combinations of sprites, which is kinda impossible to do with the picture variables (there are probably over 150~200 different combinations, but it'll be less than 5000 bytes with vertical sprites since I'm just drawing same things over and over again).
Idk if I explained it right, but yeah it's going to be used in my equipment display routine.
Also:
Big string=1+57(3)+sigma(An,n,6,62) (typical 40, say?)+1+1 (for) + 1 (i) + 1 +1+1 +1 +1 + 80? +1=2541
You have to add in another string in there because there's the hardcoded string part (the string you actually write 'into' a program) plus the string you store into a string variable
Edit: I guess if you use Ans you don't have to add that in
Edit 2: But if you hardcode it the string is not even saved in Ans so in the end, hardcoding it will take less RAM when it is executed
-
Even storing to Ans takes memory, but you could also hardcode it in a way that it still used loops, which would eliminate the extra memory used by storing to a variable, as well as the extra memory used by repeating the Text() function and newlines and so on
-
I tried to come up with a possible way to use For( and not storing string to ans, but I couldn't find a good way to do so (if all the rows had same length it's possible but then not all the row characters are same so I need to use inString, which, if you want to use it in combination with sub(, you need to save Str to some place else you'll have to hardcode the whole string twice which is worse)
-
Of course, the best way to deal with the screen problem is to just use drawing commands if the title screen is simple enough.
-
If it is simple enough, yes. I've used drawing commands to draw my title screen.
http://ourl.ca/3609/79471
But if it has a lot of black spaces, like ztrumpet's Elmgon title screen, vertical text sprite is fastest way to draw all of them other than using pic var :)