Best way to scale image for retina, not-retina

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
lonelyguy
Prole
Posts: 5
Joined: Thu Oct 27, 2016 12:41 pm

Best way to scale image for retina, not-retina

Post by lonelyguy »

Hi!

I used to work with SpriteKit on iOS and my game used that 2x size graphics for retina displays.

I'm using the same graphics for my löve game right now and when I set

Code: Select all

t.window.highdpi = true
everything looks good on the iPhone. But when I run the game on my mac (no retina display), everything is in double size of course.

How should I deal with that when I want my game to be able to run on mac/pc and various mobile devices.

Thanks!
User avatar
slime
Solid Snayke
Posts: 3181
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Best way to scale image for retina, not-retina

Post by slime »

There are a few functions to help you: [wiki]love.window.fromPixels[/wiki], [wiki]love.window.toPixels[/wiki], and [wiki]love.window.getPixelScale[/wiki].

Currently all graphics, mouse, and touch input units are in pixels rather than pixel density-scaled points, which makes dealing with it a bit of a pain. I plan to make it all a bit easier to handle for LOVE 0.11 (which isn't out yet).
lonelyguy
Prole
Posts: 5
Joined: Thu Oct 27, 2016 12:41 pm

Re: Best way to scale image for retina, not-retina

Post by lonelyguy »

Thanks for your reply. I'm really looking forward to 0.11, I think love2d is on a great way!
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 8 guests