Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: Radical Pi on January 10, 2006, 11:27:00 am

Title: [TI-BASIC] Calculator Programming
Post by: Radical Pi on January 10, 2006, 11:27:00 am
Instead of cluttering the forum with several single-question topics, ask it here. I don't expect this to be a hot topic, but anything is welcome.

I'll start with a question of my own:
How do you do 4-way homescreen scrolling usingc1-->
CODE
ec1For(A,1,8
Output(A,1,sub(Str1,???,16
Endc2
ec2I just can't fugure out the right combination of row and column variables.
Title: [TI-BASIC] Calculator Programming
Post by: tenniskid493 on January 16, 2006, 11:51:00 am
Please don't double post just to make sure someone will see your message.  As for solving your problem, here's what I came up with.

c1-->
CODE
ec1ClrHome
1->H
26->W
->X
->Y
For(A,1,8)
Output(A,1,sub(Str1,W(A-1)+X+1,16))
Endc2
ec2

Where H is the number of rows your map is going to have and W is the width of each row, X is the horiz. offset and Y is the vert. offset.

Hope that helps. :)smile.gif
Title: [TI-BASIC] Calculator Programming
Post by: Radical Pi on January 16, 2006, 01:26:00 pm
Sorry about the double post.
That only goes left and right. Is there a way to work Y into the equation?

Next question: is it possible for text to wrap on the graphscreen?
Title: [TI-BASIC] Calculator Programming
Post by: tenniskid493 on January 16, 2006, 02:47:00 pm
I'm completly guessing at this but I think if you change the c1-->
CODE
ec1Output(A,1,sub(Str1,W(A-1)+X+1,16))c2
ec2 to c1
-->
CODE
ec1Output(A,1,sub(Str1,W((A+Y)-1)+X+1,16))c2
ec2 that it should work.  Let me know if it does or not.  

As for the 2nd part, no there is no way to get text to wrap on the graph screen.  You will need to write your own text wrapping routine or else check ticalc.org...maybe there's one there.

Don't worry about the dp..its fine :Dbiggrin.gif
Title: [TI-BASIC] Calculator Programming
Post by: Liazon on January 16, 2006, 02:47:00 pm
does output do that?  I thought Disp didn't
Title: [TI-BASIC] Calculator Programming
Post by: Radical Pi on January 16, 2006, 02:58:00 pm
I fixed the scrolling (I think)

c1-->
CODE
ec1For(A,1,8
R+A-1->B
Text(-54125+1,8A-8,0,sub(Str1,64B-64+C,16
Endc2
ec2

R=row
C=column
64=level width
Title: [TI-BASIC] Calculator Programming
Post by: tifreak on January 16, 2006, 03:27:00 pm
m, I believe CDI was gonna make a tutorial for me to post on that, but I am unsure...
Title: [TI-BASIC] Calculator Programming
Post by: kalan_vod on January 16, 2006, 03:47:00 pm
QuoteBegin-Radical Pi+10 January 2006, 17:27-->
QUOTE (Radical Pi @ 10 January 2006, 17:27)
Instead of cluttering the forum with several single-question topics, ask it here. I don't expect this to be a hot topic, but anything is welcome.

I'll start with a question of my own:
How do you do 4-way homescreen scrolling usingc1-->
CODE
ec1For(A,1,8
Output(A,1,sub(Str1,???,16
Endc2
ec2I just can't fugure out the right combination of row and column variables.

For strings that are scrollable:
QuoteBegin-"BASIC Code"+
-->
QUOTE ("BASIC Code")
::"MAZES
:DelVar W:prgmLEVEL
:Lbl 1:Repeat X-87user posted image4:Output(1,1,sub(Str1,X-87,128:Output(6,8,"*
:xuser posted imageY:Repeat Ans:getKeyuser posted imageuser posted image:End:X+(user posted image=26)-(user posted image=24user posted imageX:X+16((user posted image=34)-(user posted image=25user posted imageX:If sub(Str1,X,1)="O
:Yuser posted imageX:End:W+1user posted imageW:prgmLEVEL:


QuoteBegin-"BASIC Code"+
-->
QUOTE ("BASIC Code")
:If W=4:Then:For(W,1,8:For(X,1,16:Output(W,X,"
:End:End:For(W,1,8:For(X,1,16:Output(W,X,"O
:End:End:For(W,1,8:For(X,1,16:Output(W,X,"
:End:End:Output(4,1,"THE-------------
:Output(5,1,"-------------End
:Output(8,1,"By Kalan
:Stop:End
:If W=3
:"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOEOOOOOOO OOOOOOO O
Title: [TI-BASIC] Calculator Programming
Post by: CDI on January 17, 2006, 12:03:00 am
Yeah, I have a very nice code for that (acually 2 codes) for smooth scrolling of HUGE maps and screen by screen scrolling of 128 maps... funfun I have the tut ready I just have to load it up
Title: [TI-BASIC] Calculator Programming
Post by: tifreak on January 17, 2006, 02:20:00 am
Oh, ok. :Dbiggrin.gif
Title: [TI-BASIC] Calculator Programming
Post by: Radical Pi on January 17, 2006, 11:53:00 am
more tutorials, yay!

Can any ASMers make a program that wraps large font text with the Text( command?
Title: [TI-BASIC] Calculator Programming
Post by: Liazon on January 17, 2006, 12:05:00 pm
um... correct me if I'm wrong, but puts definitely wraps automatically, and I'm not sure about vputs.
Title: [TI-BASIC] Calculator Programming
Post by: CDI on January 17, 2006, 12:09:00 pm
no, Text( does NOT wrap, nether does Disp
Title: [TI-BASIC] Calculator Programming
Post by: tenniskid493 on January 17, 2006, 12:22:00 pm
he's talking about asm commands puts and vputs...those are the asm commands for putting text onto the graphscreen.  I'm not sure about whether or not they wrap text.  I would say try it but if it doens't work that could be one big calc. crash.  Better off reading the documentation on those two calls.
Title: [TI-BASIC] Calculator Programming
Post by: CDI on January 17, 2006, 12:28:00 pm
oops, read that wrong... most code commands I know people put in quotes (not BASIC ones because everyone knows those)
Title: [TI-BASIC] Calculator Programming
Post by: dragon__lance on January 17, 2006, 02:20:00 pm
um, wat u could do is create maybe a helper program with Timendus's API, there are several good routines in there that can do wat u want ;)wink.gif
Title: [TI-BASIC] Calculator Programming
Post by: Liazon on January 18, 2006, 10:07:00 am
And API's sprite and greyscale routines are probably the fastest in existence at the moment.  Or so I believe.
Title: [TI-BASIC] Calculator Programming
Post by: Radical Pi on January 18, 2006, 10:09:00 am
I was looking for a routine that writes normal 6*8 text to the graphscreen and wraps it. Graphscreen because there I can overlap text to make the cool sprites in my War of Mmruda game.

I was pretty sure there were some flags that could toggle wether font wraps, and its size.
Title: [TI-BASIC] Calculator Programming
Post by: CDI on January 18, 2006, 10:33:00 am
hmm... I want a greyscale graphscreen text option for my own readons :Pblah.gif
Title: [TI-BASIC] Calculator Programming
Post by: Radical Pi on January 18, 2006, 10:36:00 am
I don't mean greyscale. Just two screens full of text that are ORed to the graphscreen.
Title: [TI-BASIC] Calculator Programming
Post by: CDI on January 19, 2006, 08:05:00 am
I knew that, but this is calc programming so I stated my want
Title: [TI-BASIC] Calculator Programming
Post by: Liazon on January 19, 2006, 08:28:00 am
Did Desolate have GS text?
Title: [TI-BASIC] Calculator Programming
Post by: CDI on January 19, 2006, 09:31:00 am
yep, and I loved it
Title: [TI-BASIC] Calculator Programming
Post by: DJ Omnimaga on January 19, 2006, 02:19:00 pm
in basic it woulkd be kinda hard, but possible, the text would have to be stored in advance in  two pics
Title: [TI-BASIC] Calculator Programming
Post by: dragon__lance on January 19, 2006, 03:14:00 pm
wat u can do is create a textdecoder like mine or spellshapers. in the string, when u want to go to the next line, just have a token like "-" represent it. and yeah, i think grayscale text is impracticle with BASIC, just too much work ;)wink.gif
Title: [TI-BASIC] Calculator Programming
Post by: kalan_vod on January 19, 2006, 04:57:00 pm
QuoteBegin-dragon__lance+19 January 2006, 21:14-->
QUOTE (dragon__lance @ 19 January 2006, 21:14)
wat u can do is create a textdecoder like mine or spellshapers. in the string, when u want to go to the next line, just have a token like "-" represent it. and yeah, i think grayscale text is impracticle with BASIC, just too much work ;)wink.gif

 Shame! Don't declare the possible impossible! I think a routine could be added in xlib though which reads a string and does the placing on some pics which you would have recall.
Title: [TI-BASIC] Calculator Programming
Post by: CDI on January 20, 2006, 06:22:00 am
hmm... I could do it with HS text if manages properly... or custom text?
Title: [TI-BASIC] Calculator Programming
Post by: kalan_vod on January 20, 2006, 11:16:00 am
Well it would be flashy if done with home screen, but it would take less space.
Title: [TI-BASIC] Calculator Programming
Post by: CDI on January 20, 2006, 11:18:00 am
nono, the size text... otherwise known as BIG text
Title: [TI-BASIC] Calculator Programming
Post by: kalan_vod on January 20, 2006, 11:19:00 am
Oh, well if you are going to use 8x8 blocks to use the big text I would just make my own.