Screen Size behavior

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
Griff
Prole
Posts: 8
Joined: Sat Feb 03, 2024 9:46 pm

Screen Size behavior

Post by Griff »

So i am attempting to place my char at the center of the screen so I am collecting the screen size like this

Code: Select all

function love.load()
	sw,sh = love.window.getMode()
end
then i am creating a circle at the center of screen like this

Code: Select all

function love.draw()
	love.graphics.circle("line", sw/2, sh/2, 25)
end
Im attaching my .zip file so you can see what im doing, i was able to get a sprite in the center but its very janky how i set it up
Bunny Rougelike.zip
(8.89 KiB) Downloaded 72 times
*edit
I guess i didnt say, but this does not put the circle at the center its in the bottom right
User avatar
BrotSagtMist
Party member
Posts: 655
Joined: Fri Aug 06, 2021 10:30 pm

Re: Screen Size behavior

Post by BrotSagtMist »

Somewhere in this player:draw mess you call either translate or scale which of course makes all following positions incorrect.
obey
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 5 guests