Scaling on mobile ?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
Posts: 20
Joined: Sat Jun 17, 2017 5:35 am

Scaling on mobile ?

Post by Vrx8 » Mon Jul 10, 2017 4:11 am

so.. for example.. the width of my pc is 1000 pixels.. and i make an android game in it, so if i want to make a rectangle with 250 pixels width (1/4 of the screen) and make it as big as 1/4 of my mobile phone's width.. i need to do this ?

Code: Select all"fill", x, y,, 50)
is there any easier way out ? like scaling everything on load function ?
or something like this?

Code: Select all"fill", x, y, 250 * scale, 50)

User avatar
Party member
Posts: 1182
Joined: Sat Mar 31, 2012 5:18 am
Location: Cambridge, UK

Re: Scaling on mobile ?

Post by Davidobot » Mon Jul 10, 2017 5:19 am

You can do something like this in your love.draw. See the wiki for reference.

Code: Select all

function love.draw(), 4)
	-- Draw scaled stuff
My projects: Raycaster, love.js v11.3 port
itch page: link
My website: link
My library: LovelyMoon

User avatar
Party member
Posts: 265
Joined: Wed Jun 15, 2016 8:27 am
Location: Rome, Italy

Re: Scaling on mobile ?

Post by xNick1 » Sat Jul 15, 2017 2:49 pm

As Davidobot said, otherwise use gamera by kikito!
I prefer Love api!
Currently working on a lucid dreaming adventure called Aarstider:

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests