nurpax / petmate

PETSCII editor with Electron/React/Redux
MIT License
185 stars 14 forks source link

Customizable canvas #20

Closed Esshahn closed 5 years ago

Esshahn commented 6 years ago

This one is a bit special interest.

Sometimes PETSCII screens are much bigger than just the visible 4025 area, e.g. when being scrolled. It would be fantastic to be able to set bigger canvases in the settings, e.g. 4050 for a double height PETSCII.

Viza74 commented 6 years ago

Yepp, this just came up for me - I would like to expand my Lich King pic to a scrolling multi screen tall intro of sorts.

If the screen size is too hardcoded to easily change, how about just displaying the previous and next screen under and above the current one on the canvas? (Probably not much of a help in terms of work, but maybe...)

nurpax commented 6 years ago

The problem is not so much the hardcoded width/height of the canvas itself. This is mostly parametrized throughout.

The challenge is just iterating on how it will work in terms of layout. So will there be scrollbars for a larger canvas or will we just scale to fit the canvas in the same size that's currently used for it. If the former, we also need to add some sort of "move tool" because let's face it, using scroll bars in a web site to move around is horrible.

I believe that Marq's PETSCII editor just makes the canvas bigger. So it doesn't even try to scale. That type of support would of course be easiest, but would feel unfinished and I feel like the MVP would be to at least just scale canvas to fit in the same screen estate as now.

Viza74 commented 6 years ago

I think some kind of canvas drag/zoom is a worthy goal to pursue in itself, even with a single screen size, because why not?

I tried Marq's editor a couple of days ago, but can't even make it work to display larger than one screen canvas, not sure why, so I can't comment on that.

Anyway since I last commented on this issue, I written a small external tool to watch for change in .petmate saves and display all the screens in it above/under to each other instantly - not exactly ideal, but one could work with it,,, Unfortunately I run out of any energy to create in the last couple of days, so the seven screen tall Lich king art is on hold for a bit. :-/

nurpax commented 5 years ago

I've made some decent progress on this > 40x25 screen size thing. My dev branch now supports arbitrary sized PETSCII and pan/zoom. Here's how it currently looks like:

Had to rework a bunch of things to make it work but it works quite well now. I noticed that on my Macbook scaling canvas with CSS transforms triggers a GPU rendering bug. When creating larger than NxM canvas (NxM certainly larger than 40x25), image-rendering: pixelated switches from point-sampled filtering to bilinear. Not sure if this is a bug in Chrome/Electron or Intel's GPU drivers. It's anyway really annoying. Also there were some really weird slow downs with larger canvases when GPU rendering was enabled. So I'm going to disable GPU rendering in the Petmate Electron build. I didn't notice any real slow down from this, in fact, it felt kind of snappier than before.

The canvas layout might still need some iteration. And it needs some markers for scroll bars to see where the pan/zoom is at. I hate using real browser scrollbars (they're just super clunky to use) and my code doesn't rely on them for panning, but some indication of current pan position would be really good.

Right now image size is set by tapping below the + sign for new screen. You can write say 80x50 in that input and then hit +. There's no feature to resize existing canvases.. I think that's fine for now. The work-around is to use a brush to copy bits from one screen to another.

screen shot 2019-02-23 at 12 27 48 am
Esshahn commented 5 years ago

Great work!! Recommend closing this one in favor of more detailed bug fix issues