Responsive Pixel Art
essenmitsosse.de
essenmitsosse.de
Specifically, Viewports, Blitter and Resize handling:
Viewport: https://github.com/OpenTTD/OpenTTD/blob/1.9.3/src/viewport.c...
Window resizing: https://github.com/OpenTTD/OpenTTD/blob/1.9.3/src/video/sdl_...
Zoom: https://github.com/OpenTTD/OpenTTD/blob/1.9.3/src/main_gui.c...
OpenTTD is interesting because it can have multiple "cameras" following objects on the screen. e.g. a viewport can be opened to follow a bus or train, zoomed in, while the main viewport is zoomed out.
Also I'd like to recommend aseprite (https://www.aseprite.org/), which has even cleaner code with zoom / panning / etc. The GUI itself is also pixel art: https://github.com/aseprite/aseprite/blob/v1.2.16.3/src/rend..., https://github.com/aseprite/aseprite/blob/v1.2.16.3/src/app/..., https://github.com/aseprite/aseprite/blob/v1.2.16.3/src/ui/v...
I have used OpenTTD, so I don’t know the specifics, but from how you describe it, RollerCoaster Tycoon has/had this too. The main viewport would show what you’re zoomed in/out on, while you could have a screen open following a roller coaster train.
... in x86 assembly language:
> https://en.wikipedia.org/w/index.php?title=RollerCoaster_Tyc...
> https://en.wikipedia.org/w/index.php?title=RollerCoaster_Tyc...
Don't know much about it but this surely takes a lot of work? Does every instance of movement have to be accounted for separately or would this reuse some variations?
I would guess there are thresholds which interpolate in different directions where each image represents an orthogonal axis.
You can see Zeus here, I tried looking at his website and twitter but couldn't find much.
On his Github account I can see a project https://github.com/essenmitsosse/resolution-independent-grap... but it hasn't been updated in 3 years, so I'm not sure if he used that or not.
For those missing the "magic" - try moving the cursor clockwise to each corner of the screen.
I was going to look at code (if visible), but there's an apology in the element that delayed me, at least long enough to write this comment!
The apology says:
> Please don't look to closely at this side or any of the javascript files. It's a total mess. Normaly I work much cleaner. I promise!
For the "Zeus" image (selectable from a list on the side of the screen) you get a lot of changes - Zeus goes from young to old, changes into animals, etc.
BTW, “responsive image” referring to having the image respond to resize, with anything other than uniform stretch, is absolutely standard terminology in web development.
Maybe try giving people the benefit of the doubt. And spend an extra second or two considering valid reasons why someone might post something.
See the example images in wiki: https://en.wikipedia.org/wiki/Seam_carving
Or online demo: https://alexander.soto.io/seam-carving
But if you constrain it so that any reduced resolution is carved by stepping through the path that represents a straight line from the original image, and pre-generate all images, you might end up with something that looks smooth.
(I forget the specifics of how seam carving works again, so maybe this approach makes no sense)
If you do that, then the transitions should look quite smooth. You better memoize the intermediate results if you want decent performance though ;)
So yes, I think your line of thought is on the right track!
Teiresias jumps over the snake when resized like a vertical screen
It reminds me somehow of work from Dirk Koy: https://twitter.com/DirkKoy
Don't get me wrong, it is very nice :)
Some people simply use it to create things.
Someone recently told me they were amazed of my patience, because one of my programs for computer-generated art took 20 seconds to render (meaning it takes 20 seconds, plus a bit of coding, to iterate on a previous output). Their workflow involved a few (powerful) pieces of software, with instant preview for certain tweaks. I'm going to assume most people here write a lot of code, and that you do too. Haven't we all at some time done a debugging or iterating session that took 20+ seconds just to test? (To clarify, usually my programs don't nearly take as long, but sometimes they grow increasingly more complex as I iterate, and when you also increase the resolution ...)
I'm sometimes amazed by the patience people have doing running sessions longer than 30 minutes. Or soldering many equivalent pieces on a PCB. Or reverse engineering software. Or hardware. Doing big DIY stuff to your house.
Surely there are cool things that you have patience for, that many other people would envy. Probably more than one, I have patience for cooking projects, pen and ink drawing, much more actually. I don't have time for all of it though :)
I used to have patience for rather huge (but tiny in size) projects that took half a year of coding in my free time, to write non-interactive real-time procedural graphics and audio applications called 4k demos (4096 bytes of x86 machine code). But I don't have the patience for machine code any more, and that is fine too :)
You are right, though. People have different amount of patience for things but some go beyond it. I have seen projects posted here which people worked on for a decade consistently. That is some hard work and dedication. I can't imagine doing the same and perhaps, it's better I don't. There are many different things to learn and dip into, maybe some day I will have the same patience for things I take up and throw (ADHD).