easy way to render pixelart with PIX.lua

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
jeana
Prole
Posts: 3
Joined: Thu Aug 29, 2019 1:41 pm

easy way to render pixelart with PIX.lua

Post by jeana » Thu Aug 29, 2019 2:08 pm

this is a library for full window pixel art style games
PIX.lua has 3 modes to display the screen and includes some convenient helper functions.

you set the minimum width and height the screen pixels should be and PIX.lua will create the most optimal screen size

library is available on GitHub: https://github.com/jeanahelver/PIX.lua

modes:
  • "floor", tries most optimal amount of pixels for the aspect ratio, pixels will all be equal size
  • "stretch", stretches the pixels to fill the screen, pixels could be different size
  • number, fixed amount the pixels will scale
helper functions:
  • PIX.newImage( fileName )
  • PIX.mouse.getPosition()
  • PIX.mouse.getX()
  • PIX.mouse.getX()
useful variables are PIX.width and PIX.height they will give you the current screen size

see sample main.lua for implementation details
PIX.love
(2.49 KiB) Downloaded 60 times

User avatar
D0NM
Party member
Posts: 220
Joined: Mon Feb 08, 2016 10:35 am
Location: Zabuyaki
Contact:

Re: easy way to render pixelart with PIX.lua

Post by D0NM » Fri Aug 30, 2019 8:07 pm

Yo! Cool library.
I was going to use many ifthenS for the same result.

update: I've checked your sources. Well, it is not our case.
I use "push" library and it has all the stretching modes, including the pixel-perfect one.
Our LÖVE Gamedev blog Zabuyaki (an open source retro beat 'em up game). Follow @Zabuyaki.
Twitter @FaMeSoft / GP32 Free Platformer: SUPER PLUSHA
:joker: LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua :joker:

User avatar
jeana
Prole
Posts: 3
Joined: Thu Aug 29, 2019 1:41 pm

Re: easy way to render pixelart with PIX.lua

Post by jeana » Sat Aug 31, 2019 10:46 am

what do you mean, not your case?

User avatar
jeana
Prole
Posts: 3
Joined: Thu Aug 29, 2019 1:41 pm

Re: easy way to render pixelart with PIX.lua

Post by jeana » Sat Aug 31, 2019 11:12 am

the push library you linked to seems weird.
PIX supports windowed, resized window and full screen as love.resize triggers for those switches.
PIX always uses a canvas and can be layered however you want mixed with none pixelart graphics.
PIX has 2 pixelperfect modes indexed and "floor" and can be swapped at runtime if needed for user preferences
highdpi also works on PIX

in addition PIX has helper functions to restore love2D functionality like mouse support and newImage to have crisp pixel graphics. PIX should also support mobile already.

PIX solution to overscan is to have extra pixel to not create a border, if you want a border consider using maid64 wich this library is inspired by

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests