Gspöt - retained GUI lib
Re: Gspöt - retained GUI lib
I'm still having an issue of the cameraGui not registering clicks, so! I'm gonna attach a little archive here. There's a readme within the .love to help you find the files I'm working with.
- Attachments
-
- PROJECT DEV BUILD_022419.love
- (1.47 MiB) Downloaded 515 times
Re: Gspöt - retained GUI lib
Thanks. I forgot, you also need to override cameraGUI.getmouse() like this:
Code: Select all
function cameraGUI.getmouse(this)
return camera.view:mousePosition()
end
Re: Gspöt - retained GUI lib
That worked! Thanks for the help.
Re: Gspöt - retained GUI lib
Thank you too for your question. Thanks to it, I noticed that I should have used this.getmouse() instead of love.mouse.getPosition() in the wheel event, and pushed a fix. Please update if you plan to allow wheel events in the GUI that moves with the camera.
Re: Gspöt - retained GUI lib
Will do! The project I'm working on is for mobile platform so I'll have to experiment with pinch zooming. If I notice any issues doing that, I'll be back!
Re: Gspöt - retained GUI lib
I'm having a similar problem with Camera, but I'm not using a library for my camera, i'm just using
Just like that, I have my draw function within this to have it attached to the world, and out of it to not move at all from the user's standpoint
Aside from rewriting a bunch of code to fit a library, is there a way i can solve this problem?
Code: Select all
function camera:set()
love.graphics.push()
love.graphics.rotate(-self.rotation)
love.graphics.scale(1 / self.scaleX, 1 / self.scaleY)
love.graphics.translate(-self.x, -self.y)
end
function camera:unset()
love.graphics.pop()
end
Aside from rewriting a bunch of code to fit a library, is there a way i can solve this problem?
Re: Gspöt - retained GUI lib
I can't tell without the code, but it's probably enough to redefine GUI.getmouse() like this:
Code: Select all
function GUI.getmouse(this)
love.graphics.push()
love.graphics.origin()
camera:set()
local x, y = love.graphics.inverseTransformPoint(love.mouse.getPosition())
camera:unset()
love.graphics.pop()
return x, y
end
Re: Gspöt - retained GUI lib
Hm, that's probably not enough. Try also this:
Code: Select all
function love.mousepressed(x, y, button)
x, y = GUI.getmouse()
GUI:mousepress(x, y, button)
end
Re: Gspöt - retained GUI lib
Oh! i didnt know i can redefine the built in functions, never thought about that lol
I can get you a pastebin of everything as of now but it's a bit messy and not annotated xD
I'll try that when I can get back to it
I can get you a pastebin of everything as of now but it's a bit messy and not annotated xD
I'll try that when I can get back to it
- Jack Dandy
- Prole
- Posts: 49
- Joined: Mon Sep 08, 2014 4:26 pm
Re: Gspöt - retained GUI lib
Quick question: Is there a way to change an IMAGE'S color values?
Who is online
Users browsing this forum: No registered users and 5 guests