Animated TITLE

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
LILY

Animated TITLE

Post by LILY »

Can QBASIC writes a TITLE point by point, by some animation in order to see each letter drawing itself slowly on the screen? Is this existing somewhere?
User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo »

Not any QB command I know of, but You can make yourself a function to do this easily enough...

Well mabey not....easily.... :lol:
"But...It was so beutifully done"
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

:) Using a PRINT style comand, and a hiddin control SUB I've done something of the sort, You need a good understanding of LEN(), MID$(), and logic(for putting it in a workable way)... also delays,.. hmm, here's a rough code..

Code: Select all

DECLARE SUB TYPTEXT (y!, x!, text$)
DIM SHARED delay
delay = 45000 'ajust for correct speed

TYPTEXT 1, 1, "Hello!"

SUB TYPTEXT (y!, x!, text$) 
cont = 0
DO
cont = cont + 1
ltr$ = MID$(text$, cont, 1)
phr$ = phr$ + ltr$
LOCATE y, x: PRINT phr$
IF cont = LEN(text$) THEN EXIT DO
FOR i = 1 TO delay: NEXT
LOOP
END SUB
there the example,. :wink: ,. hope it helps, just find a betta delay, or make a user setting on your game for speed control, or I seen one like that b4.. :)

EDIT: I know you want a GFX one, but this should help a lil, :wink:
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo »

Ya, I thought she ment pixels and not Letters... :wink:

Here's some psuedocode (if this is confusing please someone clear it up).

Umm, Just make the title in pixels, define an array, define it as a TYPE which has these elements in it: Idx, X, Y, Col, Status.

Intizalize all of the array.status = 0. Intizalize all of your array.x (x-coordinate of title pixel), and array.y (y-coordinate of the title pixel), and array.col (color of the title pixel) to where the pixels are in your title. Now array.Idx, intizalize this point as when you want it to activate the pixel. ie. array.Idx = 1 the pixel will show before array.Idx = 12.

Now have a DO LOOP with a delay, now put a FOR in it between LBOUND() and UBOUND() of your array. Now check IF Status = 0. If it is then check if array.Idx = the FOR LOOP index if it is then PSET (array.x, array.y), array.col. Also put array.status = 1. and that's it until all of the array.status = 1.

Well I hope that helps :)
"But...It was so beutifully done"
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

:) Umm, I was getting to the basics of typing,... you could make a array like:

Code: Select all

DIM color(80, 80)
'Cast pixal color info thru array in order you want
'x first b4 y in this case to have x read first

'Now read it across the screen,
'This one is primative, and what ever
'Mitth is on sounds more advance and 
'is probaly more what you want....
FOR x = 1 TO 80
   FOR y = 1 TO 80
      PSET (x, y), color(x, y)
      FOR i = 1 TO 1000: NEXT
   NEXT
NEXT
:) Hope me and Mitth are of help,. :wink: ,.you prob betta off with his code tho,. :)
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo »

That wasn't what I was saying cause she wanted it animated which mine will do.

But yours is good for storing pics, then siplaying them on the screen in order.

Mine is good if you want to have them show on the screen at times of your choice.
"But...It was so beutifully done"
User avatar
{Nathan}
Veteran
Posts: 1169
Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:

Post by {Nathan} »

Im to lazy to do code OR read there code, so heres what you do:

>Make a font. See other tutors or PP256 user subs for this!

>Draw it line-by-line using the put format (double buffering tutors and bsave tutors work here)

>Make a sub for ease

>Why am I such a loossseerrr?!
Image
User avatar
{Nathan}
Veteran
Posts: 1169
Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:

Post by {Nathan} »

Rattrapmax6 wrote::) Umm, I was getting to the basics of typing,... you could make a array like:

Code: Select all

DIM color(80, 80)
'Cast pixal color info thru array in order you want
'x first b4 y in this case to have x read first

'Now read it across the screen,
'This one is primative, and what ever
'Mitth is on sounds more advance and 
'is probaly more what you want....
FOR x = 1 TO 80
   FOR y = 1 TO 80
      PSET (x, y), color(x, y)
      FOR i = 1 TO 1000: NEXT
   NEXT
NEXT
:) Hope me and Mitth are of help,. :wink: ,.you prob betta off with his code tho,. :)
WILL THE FOR/NEXT DELAY MADNESS EVER END?!? :x
Image
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

It was a example dude!, and all I know right know is FOR..NEXT delay cuz I'm to lazy to look up more right now... :lol: ,.. I'll get to it, but I'm stuck in a coding swamp... anyway, look over this post, its off topic. :wink:
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo »

Nathan1993 wrote:>Why am I such a loossseerrr?!
No comment...

1. Why did you post that stuff
2. Why did you post stuff without reading other peoples posts
3. Show us a better way than FOR/NEXT delay Nate since you critizied it. Of course I'm not diagreeing with you.
"But...It was so beutifully done"
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

Nate, um, loser??? your 11 right? my bro is 11 and all he knows of QB is PRINT and LINE(x,y)-(x,y),color, B or BF.... & you pulled that parser that had me scrathing my head for a minute tell I saw what it was doing... then I found the bug,... it was a alsome code and I learned alot from it. :wink: , n I'm 18... yes leaning from you a 11 year old, your not a loser.. :)
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo »

WEll, I don't know about you but that didn't leave my head scratching....

It was good and I understood how/what he did from the moment he told us what it was suppose to do...

And I'm right in between you and him in age. BTW I wasn't coding in QB for 2 years yet. Still, an AI for QB?

Still I think six graders are hyper little energizer bunnies....lol :lol:
"But...It was so beutifully done"
User avatar
{Nathan}
Veteran
Posts: 1169
Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:

Post by {Nathan} »

Code: Select all

Now! = TIMER
DO: LOOP UNTIL TIMER > Now! + DelayTime
Image
User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo »

Ok, what if I have a RANDOMIZE TIMER?

No, no that wouldn't work...Cause its just waiting from whereever it is...

What if RANDOMIZE TIMER is in between those two statments....

Ha got you there....

No, No I still don't that wouldn't work either...crap...
RANDOMIZE TIMER doesn't make the TIMER random....instead TIMER is just the seed for the RND statement....

Ok you got me that will work. Heh....No more FOR/NEXT delays for me!
"But...It was so beutifully done"
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

Well, I never looked into MID$() LEN() and all varible reading statments, that was the first code evey I saw them used like that,. never mind.. :wink: I been playing with GFX n stuff for the most of my programing years.. :wink: , not parsers, its still a sweet cade and help me build alot of things like my HTML decrypter..
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo »

Ya, well I learned all the basics in my half-a-year class including MID$, LEN().

The rest from Files, and stuff I had to learn for myself.
"But...It was so beutifully done"
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

:) Leaning yourself is a must in FB right now, no huge selections of tuts... sucks, I'd love a OpenGL 1, but I'm stuck code hunting, REMing this and that to see what it does,.. boy does that take time.. :wink:
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo »

Doesn't it have a functional keyword list like QB had in its help file? If so them just go through learning every command.
"But...It was so beutifully done"
Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re »

Yes, it can be done using PSET and a simple font loading/using routine.

There are plenty around.


Mitth, Rattr, stop spamming. Now.
I have left this dump.
User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo »

:shock: Dude..What are you talking about Z!re?

Ok, we get off topic sometimes but not spamming, are talking legit QB and are helping/being helped so I don't know whats got you wrapped up so tight... ?-\ ...
"But...It was so beutifully done"
Post Reply