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 .
ntnick
Prole
Posts: 8 Joined: Tue Nov 11, 2014 4:51 pm
Post
by ntnick » Sun Dec 06, 2015 4:37 pm
'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?
s-ol
Party member
Posts: 1077 Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:
Post
by s-ol » Sun Dec 06, 2015 4:50 pm
Did you ever enter the gamestate? And do Gamestate.registerEvents()?
ntnick
Prole
Posts: 8 Joined: Tue Nov 11, 2014 4:51 pm
Post
by ntnick » Sun Dec 06, 2015 6:31 pm
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.
s-ol
Party member
Posts: 1077 Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:
Post
by s-ol » Sun Dec 06, 2015 10:55 pm
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.
Users browsing this forum: Ahrefs [Bot] , hmmmmxd and 4 guests