Thank you very much for this big fix, it really helps me out!
I understand that it can be tiresome to work on the same thing over a long period of time. With the scrollgroup bug fixed, Gspot is, like, 95% amazing. A pretty good score if you ask me I'll poke around and see if I can't get those things working on my own.
Gspöt - retained GUI lib
Re: Gspöt - retained GUI lib
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
Re: Gspöt - retained GUI lib
Double Post
How do you interact with other instances of Gspot? I want to display the chat system I made on more than one of my screens without having to lose any data or pasting a whole bunch of code. Is that possible
How do you interact with other instances of Gspot? I want to display the chat system I made on more than one of my screens without having to lose any data or pasting a whole bunch of code. Is that possible
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
- trubblegum
- Party member
- Posts: 192
- Joined: Wed Feb 22, 2012 10:40 pm
Re: Gspöt - retained GUI lib
I might do something like :Or you could just group up your elements with functions to construct each group as required (you should be doing this anyway). Pass them a reference to a Gspot instance if you're using more than one at a time, but one gui at a time is probably easier in the long run.
I presume when you built the element you want to interact with, you kept a reference to it, so use it.
Code: Select all
require("Gspot")
love.load = function()
state = {
common = {gui = Gspot()},
menu = {
gui = Gspot(),
update = function(this, dt)
state.common.gui:update(dt)
this.gui:update(dt)
end,
draw = function()
// you get the idea ..
end
},
world = {gui = Gspot(),
// these should really inherit from a gamestate class, since they contain identical functions.
}
}
state.current = state.menu
end
love.update = function(dt)
state.current:update()
end
love.draw = function()
state.current:draw()
end
love.mousepressed = function()
// prioritize as you see fit ..
if state.common.gui.mousein then state.common.gui:mousepress(x, y, button) else state.current.gui:mousepress(x, y, button) end
end
// etc ..
I presume when you built the element you want to interact with, you kept a reference to it, so use it.
Re: Gspöt - retained GUI lib
Thanks for the reply, mate. I'm not using a state system in my game. Instead, I am using separate love-like instances for each screen so access to a previous screen's data (such as construction references), without passing it forward, is difficult. I tried passing my chat forward and, as expected, the new instance of Gspot isn't paying it any heed.
I originally had only a single instance of Gspot but my entire gui would show up on every screen, so that wasn't too helpful either... Perhaps a global table filled with each ui group (like you posted above) is the answer.
https://github.com/karai17/love-und-pan ... nt/screens
I originally had only a single instance of Gspot but my entire gui would show up on every screen, so that wasn't too helpful either... Perhaps a global table filled with each ui group (like you posted above) is the answer.
https://github.com/karai17/love-und-pan ... nt/screens
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
- trubblegum
- Party member
- Posts: 192
- Joined: Wed Feb 22, 2012 10:40 pm
Re: Gspöt - retained GUI lib
What is this I don't even.Karai17 wrote:separate love-like instances
Re: Gspöt - retained GUI lib
Magic.
Each screen runs in its own love sandbox, controlling the main callbacks (load, update, draw, etc). Have a look through my project's code if you'd like.
https://github.com/karai17/love-und-panzer
Each screen runs in its own love sandbox, controlling the main callbacks (load, update, draw, etc). Have a look through my project's code if you'd like.
https://github.com/karai17/love-und-panzer
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
- trubblegum
- Party member
- Posts: 192
- Joined: Wed Feb 22, 2012 10:40 pm
Re: Gspöt - retained GUI lib
No need for that :\
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
- DeltaF1
- Citizen
- Posts: 64
- Joined: Mon Apr 27, 2015 4:12 pm
- Location: The Bottom of the Stack
- Contact:
Re: Gspöt - retained GUI lib
Sorry to necro this thread, but as trubblegum hasn't posted here for 3 years, I figured I'd make a post with a slightly updated version of the library. I replaced references to love.screen with love.window, removed the keyrepeat features of the library (I'll probably add these back in updated for 0.9) and tweaked the text input element to use love.textinput instead of love.keypressed (I will also be updating this so that backspace and delete work with utf8 strings properly). I'd make a pull request on github, but trubblegum seems to have dissapeared, so here it is.
The original repository is here
The original repository is here
Re: Gspöt - retained GUI lib
You could fork his repo and continue on with your own forum thread if you want to become the de facto maintainer of the project.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
Who is online
Users browsing this forum: Bing [Bot] and 0 guests