Oh I mean I am kinda tempted to work out how to do a perspective correct text crawl but it seems a lot more complicated than a simple zoom. It feels like an interesting challenge now though... I wonder how some of the old Star Wars games did it
Viewing post in I've been making a zine in Decker for almost two years
Super Star Wars would be a good example, I think - the SNES provides an easy way to scale and rotate an image like Decker’s .scale[] and .rotate[] methods. The Star Wars logo in that video looks very like the one in your deck.
For the text crawl, the SNES has an advantage: rather than scaling the whole image in one go, it can change the position and scale factor on each scanline, so the top scanlines are scaled very small, and the lower scanlines are at full size, or even scaled up.
Actually calculating which scanlines to show and the scale to show them at could be quite expensive, but luckily the perspective doesn’t change, so you could calculate them once at the beginning of the scene, or even just calculate them with a pencil and paper and type them in.
I’m imagining something like, for each line of the target canvas:
- use an easing function on the Y coordinate of the target to pick a Y coordinate of the source image
- use
.copy[0,y width,1]to grab the source scanline - use a (different?) easing function on the Y coordinate to pick a horizontal scaling factor
- use
.scale[factor,1]to scale it horizontally - optionally, use the chosen scale factor to
.map[]white pixels to one of Decker’s shaded patterns (or if you’re feeling fancy, colours in the greyscale ramp) - draw it to the target
I’m sure there’s more mathematically rigorous ways to get a proper perspective effect, but I bet that would look pretty good. The question is, would it run at 60fps?