Tiles and canvas mismatch

I'm putting this in feature requests, but it's more of a discussion about how Pyxel works than a specific request.

I've been wanting to do some game screen mockups. Preferrably I would use tiles in order to get that game engine look.
However, if you're using power of 2 tiles, then fitting that with a game resolution will be difficult if not impossible. For example; 640x360 is not evenly divisible with 16 or 32.

In Pyxel, the canvas and tiles are inextricably linked. At least right now. If you're using tiles, your canvas size is dependent on how you set up your tiles, and there's no way to set up 40 by 22,5 tiles, if you were wanting to do a 640x360 picture with 16x16 tiles.

This is not dissimilar to a topic I brought up previously regarding the animation system and how that also is linked to the tiles system.

So what I was thinking was that if the tiles were to be unlinked from these systems, but retain the functionality of them, it would open up Pyxel for a wider range of uses. Or at the very least constitute some UX quality of life improvements. I don't know if it's possible to do with how Pyxel is built, but I figured it'd be a good thing to bring up on the forums.


  • CandyFaceCandyFace Posts: 623
    I'm not sure this is a problem with PyxelEdit rather than just being a limitation of pixels in general. There is no purpose in allowing decimal tile or canvas values, since you can't get anything less than a pixel. Either you stretch the pixels slightly with a 640x360 resolution or you could use 640x352 and add a bit amount of letter boxing to avoid stretching.



    There will be a trade-off in almost any case.
  • DanikDanik Posts: 899
    It is actually possible to make the canvas width or height a fraction of the tile size, but you need to resize it after the document is created (Document>Canvas size). It's limited to extra tiles on the left and bottom though, and it hasn't been super thoroughly tested so there might be some corner case issues, but you are welcome to try it and please give me feedback if you run into any problems. :)
  • CandyFaceCandyFace Posts: 623
    edited January 2018
    That will not split the tiles up equally though, it'll just give you another row which is 16x8 (in case of a 16x16 tile), so for a mockup that wouldn't change much. While your suggestion makes it possible to get the dimensions he wants, the outcome will be the same because you'll have 8 pixels regardless of how you're getting to the resolution when each tile is 16x16 or 32x32 pixels.
  • inkBotinkBot Posts: 53
    edited January 2018
    @Danik That actually seems to work quite nicely. Being able to affect tile offset would be nice, but for now this is good. I'll be sure to send feedback if any issues do turn up with it.

    @CandyFace You seem to not understand what the point is here. You say there's no purpose for it after I explain in my post what the purpose is. At least for my specific use case. The reason for the decimal is precisely to allow for a row of "off" tiles (I never said anything about putting decimals in the canvas size), because modern screen resolutions aren't power of 2, but we use power of 2 for everything else. The goal is not to fit tiles perfectly inside the resolution, but to use tiles within a screen resolution. The stretching you talk about makes no sense because that implies I'd render the mockup inside a game engine, or resize the assets after the fact in Pyxel.

    Aside from my specific case here, I was thinking that having Pyxel be less strict about how you set up your documents could allow for some greater freedom for users. For example: Instead of (or in addition to) setting tile width and height, and amount of tiles when creating a new document; users could set the tile width and height, and then set a canvas size (and possible tile offset). We can currently do this backwards, as @Danik pointed out, so in theory that could be added to the document creation process.
  • CandyFaceCandyFace Posts: 623
    edited January 2018
    Ah I see, so it was just a request about being able to set the tile and canvas size separately when creation a document.
    My bad, I did indeed miss the point of your first post then.

    Thanks for clarifying it ;)
Sign In or Register to comment.