Mobile scaling

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
Donut-Dezz
Prole
Posts: 25
Joined: Sat Aug 03, 2019 11:56 am

Mobile scaling

Post by Donut-Dezz »

the menu render very small on mobile.but render normal(big) size on PC. how to get this menu to render the same on mobile heres the code?


function love.load()

game = {}
game.screen_width = 800
game.screen_height = 600
height,width = love.graphics.getDimensions()
awidth = width/180
aheight = height/5

titlefont = love.graphics.newFont('stylefont.otf',90)
--love.graphics.setFont(titlefont)
startbutton = love.graphics.newImage("start.png")
leavebutton = love.graphics.newImage("leave.png")
logo = love.graphics.newImage('logo.png')
menu = love.graphics.newImage('menu.png')
create = love.graphics.newImage("creation.png")




end

function love.draw()


love.graphics.print("Hello world", love.window.toPixels(width / 2 + 100, height / 2))
love.graphics.reset()
love.graphics.draw(menu,awidth,aheight)
love.graphics.draw(startbutton,10,300)
love.graphics.draw(leavebutton,556,298)
love.graphics.draw(logo,300,260)
love.graphics.draw(create,590,456)
detx = love.graphics.getWidth()
dety = love.graphics.getHeight()
--love.graphics.print(detx,200,200)
--love.graphics.print(dety,100,100)
--love.graphics.print(dem,400,300)
love.graphics.circle("fill",x,y,20,20)


--love.graphics.draw(menu,100,300)



end
User avatar
pgimeno
Party member
Posts: 3548
Joined: Sun Oct 18, 2015 2:58 pm

Re: Mobile scaling

Post by pgimeno »

What OS, and what's your love.conf?
Donut-Dezz
Prole
Posts: 25
Joined: Sat Aug 03, 2019 11:56 am

Re: Mobile scaling

Post by Donut-Dezz »

pgimeno wrote: Sun Dec 08, 2019 12:51 am What OS, and what's your love.conf?

function love.conf(t)
t.window.resizable = true
t.window.width = 480
t.window.height = 120

end



android
User avatar
pgimeno
Party member
Posts: 3548
Joined: Sun Oct 18, 2015 2:58 pm

Re: Mobile scaling

Post by pgimeno »

Are you using LÖVE 11.3?
Donut-Dezz
Prole
Posts: 25
Joined: Sat Aug 03, 2019 11:56 am

Re: Mobile scaling

Post by Donut-Dezz »

love2d 10.3
User avatar
pgimeno
Party member
Posts: 3548
Joined: Sun Oct 18, 2015 2:58 pm

Re: Mobile scaling

Post by pgimeno »

In 0.10.x you need to scale manually, using love.window.getPixelScale() for the scaling factor.

In 11.x, scaling is handled automatically, and getPixelScale has been renamed to getDPIScale.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 70 guests