Page 1 of 1

Why does this code act werid after 0.9.0?

Posted: Sat Jan 11, 2014 8:31 pm
by feelixe
I've just updated to 0.9.0, the follwing code acts weird, the canvas is draw at the wrong place. I've checked the changelog but it seems neither .scale or .setScissor has been changed. Anyone got a clue?

Code: Select all

		love.graphics.setShader(effect)
		love.graphics.scale(10, 10)
		love.graphics.setScissor( 0, 0, gameWidth, gameHeight)
		love.graphics.draw(canvas, 5, 5)
		love.graphics.setScissor()
		love.graphics.setShader()
Also worth noting is that the code above is between

Code: Select all

love.graphics.push()
and

Code: Select all

love.graphics.pop()

Re: Why does this code act werid after 0.9.0?

Posted: Sat Jan 11, 2014 8:39 pm
by veethree
Can you post the rest of the code?

Re: Why does this code act werid after 0.9.0?

Posted: Sat Jan 11, 2014 8:50 pm
by feelixe
veethree wrote:Can you post the rest of the code?
It's alot of code, so i really can't.
But this is the draw function and the code i posted before was from drawLighting()

Code: Select all

			love.graphics.push()
				love.graphics.translate(-player.act_x+love.graphics.getWidth()/2, -player.act_y+love.graphics.getHeight()/2)
				drawBlocks()
				drawDetail()	
				drawItems()
				drawEntity()
				enemyZombie.drawEnemy()
				drawInfo()
				drawWeapon()
				drawPlayer(player.grid_x/50, player.grid_y/50)
				love.graphics.draw(cloud, -player.act_x*1.08+time*4, -player.act_y*1.05-1000*0.1,0,69,69)
				drawLighting()
			love.graphics.pop()
				love.graphics.draw(weapons[1].texture,sword[4],100,100)
			drawPlayerHP()
			drawDebug()
			drawHelp()
			drawOnScreenMenu()
i noticed now that when i enter fullscreen it works just fine, the code that i use for entering fullscreen is:

Code: Select all

fullscreenEnabled = true
				love.window.setMode(0, 0, {fullscreen=true})
				love.window.setMode(love.graphics.getWidth(),love.graphics.getHeight(), {fullscreen=true, vsync=false})
updateWidthHeight()
updateWidthHeight() updates the gameWidth and gameHeight that i used in drawLighting()

Re: Why does this code act werid after 0.9.0?

Posted: Sat Jan 11, 2014 9:28 pm
by veethree
Just upload the .love as an attachment, If i/we could look at the code in context and such we could help more.

Re: Why does this code act werid after 0.9.0?

Posted: Sat Jan 11, 2014 11:40 pm
by markgo

Re: Why does this code act werid after 0.9.0?

Posted: Sun Jan 12, 2014 10:07 pm
by feelixe
It's excatly as he describe it, i don't understand how he fixed it though? is it a bug in löve?

Re: Why does this code act werid after 0.9.0?

Posted: Sun Jan 12, 2014 11:41 pm
by slime
Yeah, it's fixed for the next version (0.9.1 probably.)

Re: Why does this code act werid after 0.9.0?

Posted: Mon Jan 13, 2014 1:24 pm
by feelixe
slime wrote:Yeah, it's fixed for the next version (0.9.1 probably.)
Oh. And there's no releasedate for 0.9.1 yet?
PS. I tried the nightly release for löve and it fixed it :) thanks for the help