My tiles were flipped vertically.

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
Chucknorrisaurrus
Prole
Posts: 23
Joined: Mon Jun 07, 2010 1:00 am

My tiles were flipped vertically.

Post 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!
MissOgynist
Prole
Posts: 2
Joined: Thu Dec 23, 2010 2:26 pm

Re: My tiles were flipped vertically.

Post 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.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: My tiles were flipped vertically.

Post 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.
Help us help you: attach a .love.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: My tiles were flipped vertically.

Post 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)?
MissOgynist
Prole
Posts: 2
Joined: Thu Dec 23, 2010 2:26 pm

Re: My tiles were flipped vertically.

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 54 guests