Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: Raylin on June 17, 2010, 07:35:48 pm
-
I can't get the spacing right on this thing. D:>
"experience points!->Str27
...
For(X,0,17
Text(X*4+3,3,{Str27+X}
End
-
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.
-
"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.
-
Thanks! :D
Also, I swore my post count was over 550. o.o
-
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 :)
-
Hmm.
Would this work for finding the width of each character?
"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
-
You shouldn't need the >Dec when calling the sub, I'm pretty sure that's just for displaying.
-
Edited.
-
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.
-
s, !, ., i and j too, I believe
-
I wonder if we could modify the routine I posted to use the extra screen rows under the visible LCD memory?
-
mhmm what do you mean? Do you mean like displaying text slightly outside the screen?
-
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.
-
So do you mean like only display part of a letter then?
-
What? IIRC, there are no extra rows, but the screen is 120 bits wide (in LCD RAM)
-
My routine still gives me trouble. Any comments?
-
Really? I could have sworn there were extra rows...
Raylin, could you post a screenshot of what your original code does?
-
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.