Page 1 of 1

My tiles were flipped vertically.

Posted: Tue Jun 15, 2010 3:24 am
by Chucknorrisaurrus
I was looking at the tutorial for how to make tile-based scrolling, and long story short, when I uploaded my tiles and started the project up, all of the my tiles were upside down!

Image

I checked the forums to see if there's anything on this, but there isn't. I'm not sure how this could have come about, if this code were messed up, surely somebody would have said something on here. It's the same code as the tut with a few exceptions, but if you really want it, click here.

Any help is much appreciated!

Re: My tiles were flipped vertically.

Posted: Thu Jan 06, 2011 3:09 pm
by MissOgynist
So I was trying to be a non-annoying new user and attempted to search through the forums for an answer for my issue, but this is the only thing that came up - which seems to have gone un-answered/solved. Does anyone know why images would automatically flip them selves over?

This is my little piece of starter code:

Code: Select all

function love.load()
    House = love.graphics.newImage('Images/House.jpg')
    LittleMan = love.graphics.newImage('Images/LittleMan.jpg')
        manX = 100
        manY = 100
end

function love.update(dt)
	if love.keyboard.isDown("up") then
		manY = manY - 200 * dt
	end
	if love.keyboard.isDown("down") then
		manY = manY + 200 * dt
	end
	if love.keyboard.isDown("right") then
		manX = manX + 200 * dt
	end
	if love.keyboard.isDown("left") then
		manX = manX - 200 * dt
	end
end

function love.draw()
	love.graphics.draw(House, 200, 100)
	love.graphics.draw(LittleMan, manX, manY)
end

...and for some reason my House and LittleMan are upside-down. Obviously I have just begun testing the waters with the LOVE engine, but any help would be greatly appreciated.

Re: My tiles were flipped vertically.

Posted: Thu Jan 06, 2011 3:48 pm
by Robin
Have you tried using other image formats than JPEG? PNG is usually what you want. I never have used .jpgs in my games, so maybe it's that.

Re: My tiles were flipped vertically.

Posted: Thu Jan 06, 2011 4:17 pm
by bartbes
Nevertheless they should work, are you sure the images themselves aren't flipped (they can contain orientation data making your viewer display them correctly)?

Re: My tiles were flipped vertically.

Posted: Thu Jan 06, 2011 4:27 pm
by MissOgynist
My images -

I drew them in mspaint. Saved as a bmp, jpg, and png; all show upside-down. As far as I know, however you draw it that is how it will display.


[Edit to remove double post]:

Well, I was playing with it a little more and it seems if I save the image as a bmp first it will mess with the orientation of the image (I was converting the original bmp file to the other types). Saving the original within paint as anything other than bmp appears to produce the correct orientation. I never had this type of issue arise before.

My issue is solved - thanks for the responses though.