Vectrex32

General Category => General Discussion => Topic started by: ghosthunter on September 02, 2019, 06:08:11 AM

Title: Delay command
Post by: ghosthunter on September 02, 2019, 06:08:11 AM
How can I put a delay between drawing lines in a LineSprite so It draws slowly line by line?
Title: Re: Delay command
Post by: Vectrex32 on September 02, 2019, 08:18:54 AM
The V32 uses the Vectrex BIOS' line drawing command, so there's no way to introduce a delay there.

How much of a delay do you want? The screen refreshes 30 or so times a second, so I don't think the user would notice any delay in a single frame. What you'd have to do is draw some lines in one frame, then more lines in the next frame. That means changing the sprite from frame to frame.

- Bob
Title: Re: Delay command
Post by: ghosthunter on September 02, 2019, 08:30:57 AM
For example I want to draw the letter A line by line with half a sec delay.
Forgive my questions but I have just received it and trying to experiment.
Can you give me some sample code for doing it in many frames?
Title: Re: Delay command
Post by: Vectrex32 on September 02, 2019, 08:43:22 AM
Are you thinking that you want to draw the A using the font the Vectrex usually uses, so that the top row is drawn, then 1/2 sec. later the top two rows are drawn, then after another 1/2 second the top three rows are drawn? If that's what you want, it will be really hard because those fonts are built-in to the Vectrex and are drawn with unusual techniques that you'd have to re-create.

Or are you thinking that you want a vector font where the left leg is drawn, then the right leg, then the center bar? If that's what you want, it might not give the effect you're looking for, because wouldn't you want each line to be drawn gradually, like a pen moving?

Would you be happy with the A gradually appearing, like left to right? The lines wouldn't be drawn individually, but there'd be an effect like a "linear wipe", as movie makers would call it. That could be accomplished fairly easily with a vector font and a clipping rectangle.

- Bob
Title: Re: Delay command
Post by: ghosthunter on September 02, 2019, 08:52:53 AM
Yes Bob the gradually appearing letter is a very nice idea.
Please can I have the code?
Title: Re: Delay command
Post by: Vectrex32 on September 02, 2019, 09:43:28 AM
Take a look at the code for MBOV.bas (MissileBreak-OutVaders). The opening sequence (lines 211 through 260) draws text with a vector font and moves the text frame-to-frame, so that shows you how to animate things. Finally, it uses a clipping rectangle that changes over time to reveal text.

- Bob
Title: Re: Delay command
Post by: ghosthunter on September 02, 2019, 09:51:06 AM
Thnaks Bob I ll check it.