Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

push v1.0 #46

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

push v1.0 #46

wants to merge 3 commits into from

Conversation

htv04
Copy link
Collaborator

@htv04 htv04 commented Jul 13, 2022

Original PR: #44

  • Rewrote push to take advantage of local variables and functions instead of including non-API values in its own table. I also made it so that push no longer needs to call itself for functions, so push:function() is now push.function().
  • Simplified and extended push's setupScreen function, it no longer changes LOVE's window settings, but instead adapts to them.
    • New format is now: push.setupScreen(pushWidth, pushHeight, {upscale = ..., canvas = ...})
      • upscale (string): upscale push's resolution to the current window size
        • "normal": fit to the current window size, preserving aspect ratio
        • "pixel-perfect": pixel-perfect scaling using integer scaling (for values ≥1, otherwise uses normal scaling)
        • "stretched": stretch to the current window size
      • canvas (bool): use and upscale canvas set to push's resolution
    • Window width and height can still be overridden using push.resize(width, height).
    • This (technically) fixes Setting window width/height to 0 in push:setupScreen causes blank screen #40.
  • push now floors screen offsets internally to avoid drawing the screen in bewteen pixels.
  • push no longer creates a new table every frame when using the canvas setting, fixing memory usage steadily increases when using canvases #28 (and potentially Performance is terrible on Android if canvas flag = true #42?)
  • Removed push:setBackgroundColor(), since it was essentially just an integrated alias for love.graphics.setBackgroundColor().
  • Removed push:apply(), since it was pretty limited in functionality, only serving as an alias for push:start() and push:finish() (plus, API changes will require devs to change their code anyway).
  • Removed legacy LOVE 0.10 support.
  • Removed Mario assets from repo, because Nintendo (replaced with new LOVE-inspired pixel art).
  • Updated the README to showcase the new API, among other changes.
  • Updated low-res example.
  • Updated mouse-input example.
  • Updated main.lua, commented out unsupported examples for now.

An additional note: I think the canvas API is really cool, but it could use a little cleaning up and tweaks. Its code is mostly untouched in my rewrite, so it should work the same for now.

Also, I wanted to make the screenshot on the README a GIF like the original one, but I wasn't able to record one properly.

NOTE: Everything in this changelog is subject to change, I have made more changes and experimental features that have yet to be uploaded.

@htv04 htv04 requested a review from Ulydev July 13, 2022 02:35
@htv04 htv04 self-assigned this Jul 13, 2022
@htv04 htv04 linked an issue Jul 13, 2022 that may be closed by this pull request
@htv04 htv04 marked this pull request as draft July 13, 2022 02:51
@htv04 htv04 linked an issue Jul 13, 2022 that may be closed by this pull request
@htv04
Copy link
Collaborator Author

htv04 commented Jul 21, 2023

For anyone looking at this PR, I apologize for the inactivity. Truth is, I haven't really been in the Love2D development scene in some time; I've mostly been busy with unrelated projects. While I'm grateful I've been given write access to the repository and the opportunity to improve this module for game developers, I don't think I will be working more on this PR any time soon, as there's a lot of work to be done here.

That's not to say I'm not going to work on this PR again, and the next time I work on it, I might start from scratch so I can fine-tune everything. If anyone has any questions or suggestions, feel free to let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant