Page 1 of 1
I'm the biggest noob... Image size
Posted: Fri Apr 19, 2013 9:10 pm
by WahWah
Hi!
Completely new to much of this stuff
I wonder how i can make small images like 16x16 etc appear larger on the screen
without making them higher resolution
Like pixel size or something
Re: I'm the biggest noob... Image size
Posted: Fri Apr 19, 2013 9:19 pm
by Boolsheet
When you draw the image with
love.graphics.draw, use the scale parameters to change its size. It's a scale factor so anything below 1 makes it smaller and anything higher makes it bigger.
Code: Select all
love.graphics.draw(myImage, 10, 10, 0, 2, 4) -- The image will be two times its size horizontally and four times vertically.
In case your image is pixel art, you probably want to switch to the nearest neighbor filter. It will scale the pixels without mixing their colors for the positions in between them. See
(Image):setFilter.
Re: I'm the biggest noob... Image size
Posted: Fri Apr 19, 2013 10:12 pm
by WahWah
Boolsheet wrote:When you draw the image with
love.graphics.draw, use the scale parameters to change its size. It's a scale factor so anything below 1 makes it smaller and anything higher makes it bigger.
Code: Select all
love.graphics.draw(myImage, 10, 10, 0, 2, 4) -- The image will be two times its size horizontally and four times vertically.
In case your image is pixel art, you probably want to switch to the nearest neighbor filter. It will scale the pixels without mixing their colors for the positions in between them. See
(Image):setFilter.
Thank you!
Re: I'm the biggest noob... Image size
Posted: Fri Apr 19, 2013 10:44 pm
by WahWah
Boolsheet wrote:When you draw the image with
love.graphics.draw, use the scale parameters to change its size. It's a scale factor so anything below 1 makes it smaller and anything higher makes it bigger.
Code: Select all
love.graphics.draw(myImage, 10, 10, 0, 2, 4) -- The image will be two times its size horizontally and four times vertically.
In case your image is pixel art, you probably want to switch to the nearest neighbor filter. It will scale the pixels without mixing their colors for the positions in between them. See
(Image):setFilter.
also , since you are such a nice person (
)
could you help me with this little collision system im trying to make
if player.x > block.x and player.x < block.width and player.y < block.y then
player.y = block.y - player.pic:getHeight()
else
player.y = player.y + 1
end
it's not working so well since the player cant jump on this because as soon as he is over it he attaches to the plattform
I just havent figured out how to do this yet and i wondered if you could help me ?