Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Raylin on June 17, 2010, 07:35:48 pm

Title: Displaying one character at a time on the graph screen
Post by: Raylin on June 17, 2010, 07:35:48 pm
I can't get the spacing right on this thing. D:>

Code: [Select]
"experience points!->Str27
...
For(X,0,17
Text(X*4+3,3,{Str27+X}
End
Title: Re: Displaying one character at a time on the graph screen
Post by: Quigibo on June 17, 2010, 07:48:04 pm
You need to end that with >Char (>Frac with TI-tokens) to display it as a single character instead of the whole string every time.  Small fonts are variable sized letters, so it is not possible to assume that each letter is exactly 4 pixels wide as you are doing.  It is possible to do this in the next update though becasue I will allow you to display text without defining coordinates first kind of how you can use Disp instead of Output() and then you don't need to keep track of the location at all.
Title: Re: Displaying one character at a time on the graph screen
Post by: SirCmpwn on June 17, 2010, 07:48:32 pm
Code: [Select]
"experience points!->Str27
...
For(X,0,17
Text(X*4+3,3,{Str27+X}>Frac
End

Ninja'd

However, I feel like I can still help.  You can use this (http://ourl.ca/4129/91820 (http://ourl.ca/4129/91820)) to get the width of a string on the graph screen.  That way, you can figure out the width beforehand.  I'm not too sure how you would make this work with what you are trying to do, though.
Title: Re: Displaying one character at a time on the graph screen
Post by: Raylin on June 17, 2010, 10:10:52 pm
Thanks! :D

Also, I swore my post count was over 550. o.o
Title: Re: Displaying one character at a time on the graph screen
Post by: Ikkerens on June 18, 2010, 01:18:25 am
Thanks! :D

Also, I swore my post count was over 550. o.o

That was because the post count has been deducted when DJ removed all Axe topics...
Luckily he restored it all :)
Title: Re: Displaying one character at a time on the graph screen
Post by: Raylin on June 18, 2010, 10:06:10 am
Hmm.

Would this work for finding the width of each character?

Code: [Select]
"experience points!->Str27
<delta>List(33,105,102,108,116,122->GBD1
...
For(X,0,17
sub(WD,Str27+X)
Text(1+Y,1,{Str27+X}>Frac
Pause 100
End

Lbl WD
If r1={GBD1} or r1={GBD1+1}
1->Y
End
If r1={GBD1+2} or r1={GBD1+3} or r1={GBD1+4}
2->Y
End
If r1={GBD1+5}
4->Y
End
Return
Title: Re: Displaying one character at a time on the graph screen
Post by: FinaleTI on June 18, 2010, 10:08:41 am
You shouldn't need the >Dec when calling the sub, I'm pretty sure that's just for displaying.
Title: Re: Displaying one character at a time on the graph screen
Post by: Raylin on June 18, 2010, 10:09:57 am
Edited.
Title: Re: Displaying one character at a time on the graph screen
Post by: SirCmpwn on June 18, 2010, 10:44:32 am
In the string that you have, each character is 4 pixels wide (including the gap between characters) except for the space and the exclamation mark.  The space is one pixel wide, I'm not sure about the exclamation point.
You need to be careful about the space, "w", "z", and "*".  There might be more, but those four characters are the common ones I use that have different widths.
Title: Re: Displaying one character at a time on the graph screen
Post by: DJ Omnimaga on June 18, 2010, 05:07:59 pm
s, !, ., i and j too, I believe
Title: Re: Displaying one character at a time on the graph screen
Post by: SirCmpwn on June 18, 2010, 05:11:00 pm
I wonder if we could modify the routine I posted to use the extra screen rows under the visible LCD memory?
Title: Re: Displaying one character at a time on the graph screen
Post by: DJ Omnimaga on June 18, 2010, 05:14:00 pm
mhmm what do you mean? Do you mean like displaying text slightly outside the screen?
Title: Re: Displaying one character at a time on the graph screen
Post by: SirCmpwn on June 18, 2010, 05:16:09 pm
Right.
There are 8 rows of pixels below the screen and 8 columns of pixels to the right of the screen in the LCDs internal memory, if I remember correctly.
Title: Re: Displaying one character at a time on the graph screen
Post by: meishe91 on June 18, 2010, 05:37:14 pm
So do you mean like only display part of a letter then?
Title: Re: Displaying one character at a time on the graph screen
Post by: calcdude84se on June 18, 2010, 05:42:06 pm
What? IIRC, there are no extra rows, but the screen is 120 bits wide (in LCD RAM)
Title: Re: Displaying one character at a time on the graph screen
Post by: Raylin on June 18, 2010, 08:15:50 pm
My routine still gives me trouble. Any comments?
Title: Re: Displaying one character at a time on the graph screen
Post by: SirCmpwn on June 19, 2010, 02:22:53 am
Really?  I could have sworn there were extra rows...
Raylin, could you post a screenshot of what your original code does?
Title: Re: Displaying one character at a time on the graph screen
Post by: Raylin on June 19, 2010, 07:50:04 am
My calculator is missing right now. But, the best I can do is tell you what it does.

The variable widths on the 1px, 2px, and 4px are off.
So, because I multiply my expression by 4, my 'i''s are 2 more pixels spread out than they should be.