I've been working with Love2d Android for some time now, and I've noticed that using a canvas for pixelated effect doesn't work according to the scale.
I tried scaling the images to a scale of 0.5 and the pixels seem to be displayed correctly, somehow.
Is this scaling normal, or am I missing something?
As shown in the attachement, the original character is of 16px height (for the character) but on rotating, each (image) pixel seems to be made of 4 (screen/canvas) pixels. I'm not sure if this is a problem with canvas, images, or Android, because even without a canvas, the low resolution images are displayed at higher scale than the actual resolution.
I tried checking the DPIScale of the image and it's 1.[Love2d Android] Wrong scaling of images
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
[Love2d Android] Wrong scaling of images
Love2d+Android+Pixel Art = bhgt
Re: [Love2d Android] Wrong scaling of images
What version of LÖVE are you using?
Can you give more precise instructions to reproduce the problem? Preferably a short program demonstrating it.
Can you give more precise instructions to reproduce the problem? Preferably a short program demonstrating it.
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: [Love2d Android] Wrong scaling of images
It's just a hunch, but usually with this kind of issue, the culprit is usually the fact that while a canvas might indeed be low-resolution, but when the canvas itself gets rotated when it's drawn to the backbuffer (which i'm assuming is indeed of a higher resolution), the blockiness of the contents may not be preserved in some cases.
From the image, i'm guessing you're scaling the canvas first and then rotating (or maybe you're using such parameters with love.graphics.draw), for what i'm guessing you're after, you'd need to rotate first, then scale, to preserve blockiness, i think.
From the image, i'm guessing you're scaling the canvas first and then rotating (or maybe you're using such parameters with love.graphics.draw), for what i'm guessing you're after, you'd need to rotate first, then scale, to preserve blockiness, i think.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: [Love2d Android] Wrong scaling of images
LOVE Android operates on DPI-scale.
* When making new Canvas, Canvas expects the size to be DPI-scaled unless you pass {dpiscale=1} to the 3rd argument.
* When drawing image, the image is drawn in DPI-scaled units and not in pixels.
* When making new Canvas, Canvas expects the size to be DPI-scaled unless you pass {dpiscale=1} to the 3rd argument.
* When drawing image, the image is drawn in DPI-scaled units and not in pixels.
Profile. Do you encounter crashes in LÖVE Android and wanna send me logcats? Please hit me up in LÖVE Discord and send the full logcat file!
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 5 guests