love.graphics.draw not drawing anything.

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
ntnick
Prole
Posts: 8
Joined: Tue Nov 11, 2014 4:51 pm

love.graphics.draw not drawing anything.

Post by ntnick »

'ello love2d forums.

I'm using HUMP's gamestate module, and calling love.graphics.draw from a gamestate's :draw function dosen't work.

Code: Select all

tiles = {}

player = { x = 10, y = 10, speed = 15 }
maptest = love.graphics.newImage("images/maptest.png")

function tiles:draw()
  love.graphics.draw(maptest, 1, 1)
end

return tiles
Basically, the image dosen't render.
maptest.png is 640x640, and I've tried using other images but they don't work either.

Any suggestions?
:awesome: :x
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: love.graphics.draw not drawing anything.

Post by s-ol »

Did you ever enter the gamestate? And do Gamestate.registerEvents()?

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
ntnick
Prole
Posts: 8
Joined: Tue Nov 11, 2014 4:51 pm

Re: love.graphics.draw not drawing anything.

Post by ntnick »

S0lll0s wrote:Did you ever enter the gamestate? And do Gamestate.registerEvents()?
I did enter the gamestate, but I haven't used .registerEvents yet. I'll try that, and report back.

edit: .registerEvents did not work. Nothing is being rendered.
:awesome: :x
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: love.graphics.draw not drawing anything.

Post by s-ol »

Well if you don't post your full code we can't help. It cannot work without .registerEvents unless you call Gamestate.draw on your own in love.draw. Also if you have a custom love.draw already you need to make sure .registerEvents is called after defining that, for example in love.load.

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], hmmmmxd and 4 guests