Hello.
Got a question ...
The documentation is written
«Love.graphics.newImage
Creates a new Image from a file path. Note that the x and y dimensions of the image must (currently) be a power of two, or some graphics cards will not display it. »
I need to insert a picture, size: 1024:768
How to do it?
Thanks in advance!
Love.graphics.newImage
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Love.graphics.newImage
Make the image 1024x1024 and use quads (if the screen is bigger than 1024x768) to crop off the bottom. The benefit to quads being you can use the remaining 1024x256 pixel area for other interface elements.
Just remember, some video cards won't display images bigger than 2048 and others 1024, but there's no way to know what your user is going to have. So be safe and use small images whenever possible to avoid headaches later when your users start filing bug reports about missing images even though it might work fine on your computer.
Just remember, some video cards won't display images bigger than 2048 and others 1024, but there's no way to know what your user is going to have. So be safe and use small images whenever possible to avoid headaches later when your users start filing bug reports about missing images even though it might work fine on your computer.
- nevon
- Commander of the Circuloids
- Posts: 938
- Joined: Thu Feb 14, 2008 8:25 pm
- Location: Stockholm, Sweden
- Contact:
Re: Love.graphics.newImage
What would be the benefit of doing this instead of just adding transparent padding?Jasoco wrote:Make the image 1024x1024 and use quads (if the screen is bigger than 1024x768) to crop off the bottom. The benefit to quads being you can use the remaining 1024x256 pixel area for other interface elements.
Re: Love.graphics.newImage
You can use the remaining 1024x256 area to put other images and use quads to pickup what you need to draw from the 1024x1024 image. If you just fill it with transparent pixels, it's a waste of texture memory.nevon wrote:What would be the benefit of doing this instead of just adding transparent padding?
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Love.graphics.newImage
That sounds a lot like premature optimisation. And using quads is much more complicated than single images.leiradel wrote:You can use the remaining 1024x256 area to put other images and use quads to pickup what you need to draw from the 1024x1024 image. If you just fill it with transparent pixels, it's a waste of texture memory.
Help us help you: attach a .love.
Re: Love.graphics.newImage
Although grouping several images into fewer PO2 images is premature during production it's better to use quads from the beginning because otherwise there would be a lot of code to change when the time comes for that optimization, if you want to do it of course. Quads can be encapsulated in a class to make their use easier, but yeah, it's more complicated than using images.Robin wrote:That sounds a lot like premature optimisation. And using quads is much more complicated than single images.
Cheers,
Andre
Who is online
Users browsing this forum: No registered users and 3 guests