Page 2 of 2
Re: ochres: HSL palette composer
Posted: Sun Nov 04, 2012 10:36 pm
by spir
Larsii30 wrote:Looks intresting.
One thing I would like to have was to just hold the left mouse button instead of click everytime to change the settings. ( slider ).
Oh, do you mean sliding the scale by moving up/down the mouse with left button held down (like drag & drop)? If yes, it could be done but a bit costly: all 3 scales (vertical gradual color boxes) must be recomputed every the main color is changed, you see? Each one shows the whole range of one of the h,s,l components for the present value of the other 2 components. So, if you slide one scale with the mouse, then as long as the button is held down and changes the color the program would constantly have to recompute all 3 scales. Or maybe, I could use a timer or counter to do it only every n ms or n frames... What do you think?
Also: is it worth it?
PS: What do you think of the present way to adjust colors (with click for gross setting and arrow keys for finer adjustment)? And, is the help text good enough?
PPS: Has anyone had a look at the code?
Denis
Re: ochres: HSL palette composer
Posted: Sun Nov 04, 2012 10:40 pm
by Nixola
It doesn't find the help file here, Windows 7 both x86 and x64
Re: ochres: HSL palette composer
Posted: Mon Nov 05, 2012 1:42 pm
by spir
Nixola wrote:It doesn't find the help file here, Windows 7 both x86 and x64
Hum, weird... The help file (called just 'help', it's plain text) is well included in the .love (just checked). Would you verify it's there, by you?
Else, the code to read & write it is simplistic:
Code: Select all
composer.write_help_text = function (composer)
local msg = "Sorry, no help text file found..."
local text
-- Try and get help text from help file.
local f = io.open("help", 'r')
if f then
text = f:read("*all")
f:close()
else
text = msg
end
-- Write it on blank screen due to mode "help":
graf.setColor(BLACK)
graf.print(text, 15,15)
end
If you like, just add a pair of lines to print out the file handle 'f' after, after the attempt to open:
Code: Select all
print("file handle:", f)
graf.print("file handle: " .. tostring(f), 0,0)
(The second line because I don't know about the terminal on Wondows.)
Thanks,
Denis
Re: ochres: HSL palette composer
Posted: Mon Nov 05, 2012 1:57 pm
by Nixola
Try using love.filesystem instead of the io Lua module:
love.filesystem.read
love.filesystem.exists
love.filesystem
Re: ochres: HSL palette composer
Posted: Tue Nov 06, 2012 4:01 pm
by spir
Right, thank you for the tip.
(May I ask why? what's wrong with Lua io?)
Re: ochres: HSL palette composer
Posted: Tue Nov 06, 2012 10:26 pm
by Robin
spir wrote:(May I ask why? what's wrong with Lua io?)
Lua io.* can't deal with .loves or merged executables and it doesn't know how to find the save dir, making it pretty much completely useless for LÖVE games. On top of that, SELÖVE disables the io.* functions.
Re: ochres: HSL palette composer
Posted: Wed Nov 07, 2012 10:04 am
by spir
Robin wrote:spir wrote:(May I ask why? what's wrong with Lua io?)
Lua io.* can't deal with .loves or merged executables and it doesn't know how to find the save dir, making it pretty much completely useless for LÖVE games. On top of that, SELÖVE disables the io.* functions.
Thank you, Robin, pretty clear
[I really have
much to learn... great! lövely!]
Denis