Center image and resize to actual size
Posted: Tue Apr 21, 2020 4:22 am
Hello, I am trying to place a image in my game and have no idea what I'm doing lol.
I want it in the center of the screen, and the size of the actual image.
Instead, I get a really, really big image and not at all in the center.
This is my code:
Thank you! Please explain how it works too please.
I don't just want the correct code, I want to understand why it's correct!
I want it in the center of the screen, and the size of the actual image.
Instead, I get a really, really big image and not at all in the center.
This is my code:
Code: Select all
gReward = love.graphics.newImage('goldReward.png')
quad = love.graphics.newQuad(0, 0, 128, 64, gReward:getWidth(), gReward:getHeight())
love.graphics.draw(gReward, 100, 100, 0, 1, 1, VIRTUAL_WIDTH / 2, VIRTUAL_HEIGHT / 2)
I don't just want the correct code, I want to understand why it's correct!