i don't want to use fixed values :S
i was thinking love.graphics.getWidth(img) but that didn't work
how to find the width and height of an image?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Citizen
- Posts: 63
- Joined: Sun May 13, 2012 2:49 am
Re: how to find the width and height of an image?
Say you made your Image:
then if you want to set width to the Width you do:
Now width should be the width of image (in pixels)
EDIT: You don't need to thank for the speedy reply, everyone here replies really fast (!)
Code: Select all
img = love.graphics.newImage("PATH/TO/IMAGE")
Code: Select all
width = img:getWidth( )
EDIT: You don't need to thank for the speedy reply, everyone here replies really fast (!)
u wot m8
-
- Citizen
- Posts: 63
- Joined: Sun May 13, 2012 2:49 am
Re: how to find the width and height of an image?
thanks anyways!rokit boy wrote:EDIT: You don't need to thank for the speedy reply, everyone here replies really fast (!)
Re: how to find the width and height of an image?
Always happy to help.onedaysnotice wrote:thanks anyways!rokit boy wrote:EDIT: You don't need to thank for the speedy reply, everyone here replies really fast (!)
u wot m8
Who is online
Users browsing this forum: No registered users and 54 guests