Lua inputbox: Allow negative values and floating point input. Unfinished, has problems of display (mouse cursor cleaning, display cleaning and alignment, removing redundant digits like in 15.000)

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1354 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud
2010-02-19 02:09:50 +00:00
parent f05906f99b
commit 14464fef39
8 changed files with 156 additions and 41 deletions

31
scripts/settings.lua Normal file
View File

@@ -0,0 +1,31 @@
-- Test LUA inputbox
-- this script only resizes the brush
w, h = getbrushsize()
--[[
messagebox(
"Forecolor: " .. getforecolor() .. "\n" ..
"Backcolor: " .. getbackcolor() .. "\n" ..
"Transparent color: " .. gettranscolor() .. "\n" ..
"Brush dimensions: " .. w .. "x" .. h
)
]]
ok, w, h = inputbox("Modify brush",
"Width", w, -100.0,100.0, 0,
"Height", h, -200.0,100.0, 0,
"X Flip", 0, 0, 1, 0,
"Y Flip", 0, 0, 1, 0
);
if ok == true then
setbrushsize(w,h)
for y = 0, h-1, 1 do
for x = 0, w-1, 1 do
putbrushpixel(x,y,1);
end
end
end