Delay command

Started by ghosthunter, September 02, 2019, 06:08:11 AM

Previous topic - Next topic

ghosthunter

How can I put a delay between drawing lines in a LineSprite so It draws slowly line by line?

Vectrex32

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

ghosthunter

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?

Vectrex32

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

ghosthunter

Yes Bob the gradually appearing letter is a very nice idea.
Please can I have the code?

Vectrex32

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

ghosthunter

Thnaks Bob I ll check it.