hi, i want to learn how to show images on the screen, but idk which kind of image i must use, the one in the graphics or in the image of love? and can you tell me if this kind got position property? also is it possible to make a certain color completly invisible?
thanks scripto
Which kind of image.
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Which kind of image.
Images are loaded with love.graphics.newImage().
They don't have a position property, they are arguments to the love.graphics.draw function:
You probably want to keep a variable around for most images. You can use tables for this:
They don't have a position property, they are arguments to the love.graphics.draw function:
Code: Select all
function love.draw()
love.graphics.draw(myimage, x, y)
end
Code: Select all
player = {img = love.graphics.newImage("player.png"), x = 100, y = 200}
AFAIK not. But many image formats (such as PNG) have alpha channels you can use to make parts invisible. (Or partly visible, for example for ghosts.)scripto wrote:also is it possible to make a certain color completly invisible?
Help us help you: attach a .love.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Which kind of image.
Ah, that reminds me, I wanted to make a lib to do that...
Re: Which kind of image.
Ok so you can make an image with a png? and for the getPixel and setPixel, is there any ways to use it using love.graphics or is there any way to convert a love.graphic image to a love.image then switch it back once you made your changes?
- TechnoCat
- Inner party member
- Posts: 1611
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Milwaukee, WI
- Contact:
Re: Which kind of image.
This is either a job for Photoshop, or ImageData!scripto wrote:also is it possible to make a certain color completly invisible?
http://web.ics.purdue.edu/~dcfritz/file ... tract.love
REMINDER: .love files can always be opened as an archive (WinRAR, 7zip, etc). Presumably to view the source code.
UPDATE: Realized you wanted something to subtract a certain color for sprite sheets. This doesn't do that.
Last edited by TechnoCat on Sun Jan 31, 2010 6:32 pm, edited 1 time in total.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Which kind of image.
I have created and posted a small color masking function in the Projects & Demos section: here
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 6 guests