simple-slider
- Positive07
- Party member
- Posts: 1014
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: simple-slider
Question! Could I make a material theme for this and make it part of my [shameless plug]Material-Love[/shameless plug] set of libraries? Of course with propper credits!
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
Re: simple-slider
Wow that is really prettyPositive07 wrote:Question! Could I make a material theme for this and make it part of my [shameless plug]Material-Love[/shameless plug] set of libraries? Of course with propper credits!
- Positive07
- Party member
- Posts: 1014
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: simple-slider
Ohh! Thanks the best part is that is really slow on my PC hahaha those freaking shadows!!Kasperelo wrote: Wow that is really pretty
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
- georgeprosser
- Citizen
- Posts: 68
- Joined: Fri Mar 28, 2014 5:55 pm
Re: simple-slider
Yeah sure, though you might find it easier to start from scratch and use this as a guide.Positive07 wrote:Could I make a material theme for this and make it part of my [shameless plug]Material-Love[/shameless plug] set of libraries? Of course with propper credits!
Re: simple-slider
@georgeprosser : Very nice and smart. It's indeed very usefull for some small applications.
Some suggestions.
* keep a list of all sliders and make one silderinstance:update() and silderinstance:draw() function, so you don't need to specify this for every slider
* push it to github
* don't make it global, return slider so people can do:
Some suggestions.
* keep a list of all sliders and make one silderinstance:update() and silderinstance:draw() function, so you don't need to specify this for every slider
* push it to github
* don't make it global, return slider so people can do:
Code: Select all
local silderinstance = require 'simple-slider'
- georgeprosser
- Citizen
- Posts: 68
- Joined: Fri Mar 28, 2014 5:55 pm
Re: simple-slider
* I'll leave this for people to handle themselves. For all my projects I have a 'container' class. The container is just a wrapper for a table, and when you call container:update(dt) or container:draw() it just calls that method on all objects on the table.SiENcE wrote: Some suggestions.
* keep a list of all sliders and make one silderinstance:update() and silderinstance:draw() function, so you don't need to specify this for every slider
* push it to github
* don't make it global
* I'm a github noob :-/
* I have never really worked out how to handle scope with Lua & LÖVE. I feel like stuff needs to be created in love.load(), but then it has to be global. These days I have a few global objects, like a 'game' object or a controller, and then things like players or bullets can be members eg. game.player. I copied the way AnAL deals with this.
- Positive07
- Party member
- Posts: 1014
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: simple-slider
Please dont! What happens if for some reason I dont wanna update A SINGLE the slider?, for example I wont be showing it this frame so I dont want it to catch mouse events. Other case I simply dont wanna call draw for an specific slider but I have a single draw function! also how do you specify drawing order? for example I have a slider and then I want to draw a semitransparent overlay on top of it and after that another slider, but I have a single draw function!SiENcE wrote: * keep a list of all sliders and make one silderinstance:update() and silderinstance:draw() function, so you don't need to specify this for every slider
I dont think this method is nice, it should be left to the user!
I'm at favor of the NOT global idea, you should always return a local table, but I understand if it is not your top priority
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
Re: simple-slider
It's an simple slider implementation, not a complex gui system .Positive07 wrote:Please dont! What happens if for some reason I dont wanna update A SINGLE the slider?, for example I wont be showing it this frame so I dont want it to catch mouse events. Other case I simply dont wanna call draw for an specific slider but I have a single draw function! also how do you specify drawing order? for example I have a slider and then I want to draw a semitransparent overlay on top of it and after that another slider, but I have a single draw function!SiENcE wrote: * keep a list of all sliders and make one silderinstance:update() and silderinstance:draw() function, so you don't need to specify this for every slider
Re: simple-slider
This library is great. You need to make it live on github.
- georgeprosser
- Citizen
- Posts: 68
- Joined: Fri Mar 28, 2014 5:55 pm
Re: simple-slider
I've just updated this library to work with LÖVE 0.10.1
I've also added 2 features:
I've also added 2 features:
- 'roundrect'
by Robin Wellnerfor track style - optionally supply your own parameters with slider:update(mouseX, mouseY, mouseDown) - allows you to handle your own canvas offsets etc. and to use a different key's state for input, eg. with a controller
Last edited by georgeprosser on Sun Aug 28, 2016 7:41 am, edited 1 time in total.
Who is online
Users browsing this forum: Google [Bot] and 1 guest