Page 1 of 1

Help with pictures and such

Posted: Fri Sep 27, 2013 11:07 pm
by AnDwHaT5
Hello i am AnDwHaT5. I am a bit new here atm so let me begin with my question of noobie-ness.

I would like to use a character sprite on a picture that i have. Though when i rendered it in it took out my picture and replace the entire thing with the sprite.
What i wish to do is make the sprite movable on the background picture. I have tried the wiki however it needs a small amount of work such as example codes. There arnt many of them but when i get them they are very helpful ^_^. Also while i am asking when i use the audio it dosnt work right. It comes out all echoy. I have tried .ogg and mp3 both came out the same. Some assistance on this would be nice. (I used stream)

Re: Help with pictures and such

Posted: Sat Sep 28, 2013 1:43 am
by DaedalusYoung
Could you post a .love file?

If you're using a spritesheet, I'd recommend using quads, which allow you to only draw a small part of an image. Check out the functions related to quads on the love.graphics page.

As for the audio, I have no clue, we'd need to examine your files for that.

Re: Help with pictures and such

Posted: Sat Sep 28, 2013 12:36 pm
by davisdude
Yeah, we can't really help you without a .love.
Are you trying to do an animation? Or just move the character along a background picture?
Additional clarification helps us help you! :)

Re: Help with pictures and such

Posted: Sat Sep 28, 2013 7:02 pm
by Sheepolution
You can load in images and store these in variables.

Code: Select all

 variableName = love.graphics.newImage("url/to/image.png")
What you might have done is assigning both images to the same variable. Make sure you use different ones.

Code: Select all

 background = love.graphics.newImage("background.png")
 sprite = love.graphics.newImage("sprite.png")
If that is not your problem, please explain better.

Re: Help with pictures and such

Posted: Wed Oct 02, 2013 4:45 pm
by AnDwHaT5
What i want to do is when i use if keypress.isDown("right") then is i want it to replace the current sprite with a different image in the spot defined by using say x = x + 1. My issue is it updates it but then defaults back when the if then statement is over.