I'm the biggest noob... Image size

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
User avatar
WahWah
Prole
Posts: 6
Joined: Fri Apr 19, 2013 9:03 pm

I'm the biggest noob... Image size

Post 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 :P
User avatar
Boolsheet
Inner party member
Posts: 780
Joined: Wed Dec 29, 2010 4:57 am
Location: Switzerland

Re: I'm the biggest noob... Image size

Post 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.
Shallow indentations.
User avatar
WahWah
Prole
Posts: 6
Joined: Fri Apr 19, 2013 9:03 pm

Re: I'm the biggest noob... Image size

Post 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! :D
User avatar
WahWah
Prole
Posts: 6
Joined: Fri Apr 19, 2013 9:03 pm

Re: I'm the biggest noob... Image size

Post 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 ( :D )
could you help me with this little collision system im trying to make :3

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 :P
I just havent figured out how to do this yet and i wondered if you could help me ? :)
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 1 guest