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
Mobile scaling
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Mobile scaling
What OS, and what's your love.conf?
-
- Prole
- Posts: 25
- Joined: Sat Aug 03, 2019 11:56 am
Re: Mobile scaling
Are you using LÖVE 11.3?
Re: Mobile scaling
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.
In 11.x, scaling is handled automatically, and getPixelScale has been renamed to getDPIScale.
Who is online
Users browsing this forum: Google [Bot] and 70 guests