push - a resolution-handling library

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
ac3raven
Citizen
Posts: 50
Joined: Tue May 19, 2009 1:14 am

Re: push - a resolution-handling library

Post by ac3raven » Sun Apr 07, 2019 10:06 pm

I spoke too soon. the change I made broke my shader rendering. I am not sure how fix it, so back to the drawing board :(

User avatar
ac3raven
Citizen
Posts: 50
Joined: Tue May 19, 2009 1:14 am

Re: push - a resolution-handling library

Post by ac3raven » Wed Apr 10, 2019 2:28 am

I am not understanding how to give a pre-existing shader to Push. One that I create with love.graphics.newCanvas() and that does not take up the entire screen.

Or how might I create a canvas with Push that has width and height parameters?

Like so:

Code: Select all

local canvas = lg.newCanvas(350,60)

function stencilFunction()
  rainbow_shader:send("scaler",scaler)
  rainbow_shader:send("rot",r)
  push:setShader(rainbowmask_shader)  --I can't use the push:(canvasName,shader) syntax here with my normal canvas
  lg.print(scoretext,lg.getWidth()/2-28,30)
  push:setShader()
end

local canvasList = {name = "test",shader=rainbow_shader}  --how do I add my normal canvas to this so I can use push:setupCanvas on it??
push:setupCanvas(canvasList)

gameplay:update(dt)
  push:setCanvas(test) --this should be applying the 'rainbow_shader' to the below rect
  lg.rectangle("fill",0,0,lg.getWidth(),lg.getHeight())
  push:setCanvas()
end

gameplay:draw()
  lg.stencil(stencilFunction,"replace",1)
  lg.setStencilTest("greater",0)
  scoretext = tostring(math.floor(currentscore))
  lg.setColor(1,1,1,1)
  if newHighScore then
    lg.draw(canvas,score.x,score.y2) -- I need my canvas to be drawn at this position, after it passes through the stencil function
  end
end


User avatar
Ulydev
Party member
Posts: 438
Joined: Mon Nov 10, 2014 10:46 pm
Location: Paris
Contact:

Re: push - a resolution-handling library

Post by Ulydev » Wed Apr 10, 2019 11:25 am

Hmm, I'm not sure how you can display a not-fullscreen with push, it's been a while and I honestly don't remember how it works exactly. I need to go through the code again so I can help you :-) I'll be sure to reply as soon as I have some time!

User avatar
Jack Dandy
Prole
Posts: 47
Joined: Mon Sep 08, 2014 4:26 pm

Re: push - a resolution-handling library

Post by Jack Dandy » Sat Jul 06, 2019 9:02 am

Heya. Just wanted to know if the stencil problem's been fixed?

User avatar
Ulydev
Party member
Posts: 438
Joined: Mon Nov 10, 2014 10:46 pm
Location: Paris
Contact:

Re: push - a resolution-handling library

Post by Ulydev » Thu Jul 11, 2019 7:17 pm

Jack Dandy wrote:
Sat Jul 06, 2019 9:02 am
Heya. Just wanted to know if the stencil problem's been fixed?
It seems like it's been fixed, although I haven't tried it myself yet: https://github.com/Ulydev/push/issues/25

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests