Hi guys, I'm new to using Love and have been having trouble with drawing a background for my game.
I've been trying to draw a relatively small background for my game (800x600) but whenever is draw it, the game lags horribly. I'm not sure what I'm doing wrong or what I can do to fix it. The code goes a bit like this.
function love.draw()
if gamestate == "playing" then
love.graphics.draw(background,0,0)
end
end
Any advice would be appreciated!
Laggy drawings (new to Love)
Re: Laggy drawings (new to Love)
We can't help you without a .love
My guess is that you've put a love.graphics.newImage function inside of love.draw
My guess is that you've put a love.graphics.newImage function inside of love.draw
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Re: Laggy drawings (new to Love)
Could be a graphics card or cpu issue, I know i have issues loading images as a background, its because my system is a dell dimension p4 pos lol
When your writing out your code and including assets in your application you have to consider your systems limitations.
The way love works is love initially loads whatever is inside of love.load only once and then its a ping pong of loading love.update & love.draw back and forth until your program ends.
So when your drawing something to the screen it isn't just drawn once, it is drawn every other cycle for the life of the program.
Something to keep in mind
When your writing out your code and including assets in your application you have to consider your systems limitations.
The way love works is love initially loads whatever is inside of love.load only once and then its a ping pong of loading love.update & love.draw back and forth until your program ends.
So when your drawing something to the screen it isn't just drawn once, it is drawn every other cycle for the life of the program.
Something to keep in mind
Re: Laggy drawings (new to Love)
There is a chance it's a driver issue but you have probably just screwed up, a .love would help.
Who is online
Users browsing this forum: No registered users and 3 guests