my = my or {}
function createGrid()
local width, height = getMainWindowSize();
local temp_x = 0 - width/80
local temp_y = 0 - height/40
for j=1,40 do
temp_y = temp_y + height/40
temp_x = 0 - width/80
for i=1,80 do
temp_x = temp_x + width/80
createLabel("my.messageBox"..j..i,0,0,0,0,1)
setLabelStyleSheet("my.messageBox"..j..i, [[
background-color: rgba(0,0,0,0);
border-style: dotted;
border-width: 1px;
border-color: white;
]])
setLabelOnEnter("my.messageBox"..j..i,"onEnter",j..i)
setLabelClickCallback("my.messageBox"..j..i,"onClick",i,j)
moveWindow("my.messageBox"..j..i, temp_x, temp_y)
resizeWindow("my.messageBox"..j..i, width/80, height/40)
showWindow("my.messageBox"..j..i);
end
end
createLabel("my.display",0,0,0,0,1)
setLabelStyleSheet("my.display", [[
background-color: rgba(0,0,100,100);
border-style: solid;
border-width: 2px;
border-color: blue;
]])
moveWindow("my.display", width - width/4 -100, height - height/4 -100)
resizeWindow("my.display", width/5, height/5)
showWindow("my.display");
createLabel("my.prompt",0,0,0,0,1)
setLabelStyleSheet("my.prompt", [[
background-color: rgba(0,0,0,0);
]])
moveWindow("my.prompt", width - width/4 -100, height - height/4 -100)
resizeWindow("my.prompt", width/5, height/10)
showWindow("my.prompt");
echo("my.prompt",[[<span style= "font-size: 10pt"><span style= "color: white"><center>Select a starting point then click OK</center></span></span>]])
createLabel("my.OK",0,0,0,0,1)
setLabelStyleSheet("my.OK", [[
background-color: rgb(0,0,100);
border-style: solid;
border-width: 1px;
border-color: white;
border-radius: 5px;
]])
moveWindow("my.OK", width - width/4 -100 + 50, height - height/4 -100 + (height/8))
resizeWindow("my.OK", width/5 - 100, height/15)
showWindow("my.OK");
echo("my.OK",[[<span style= "font-size: 14pt"><span style= "color: white"><center>OK</center></span></span>]])
end
function onEnter(name)
setLabelStyleSheet("my.messageBox"..name, [[
background-color: yellow;
border-style: dotted;
border-width: 1px;
border-color: white;
]])
end
function onClick(width,height)
local w, h = getMainWindowSize()
local w, h = math.floor(width * (w / 80) - (w / 80)), math.floor(height * (h / 40) - (w / 80))
echo("my.display",[[<span style= "font-size: 16pt"><span style= "color: white"><center>X: ]]..w..[[ Y: ]]..h..[[</center></span></span>]])
end
createGrid()
A Grid
A Grid
I built this 80 x 40 label grid while testing what Mudlet could handle. But I'm getting these black squares at the top where the grid should be. Here's the code and a video of what it looks like currently. What's causing the black squares up top? http://youtu.be/dqKS0CP2kg0
Re: A Grid
I once had a clever idea of making a grid of labels for a fullscreen Mudlet (1440x900 resolution back then). It made the mouse lag to move it around.
I tried it out and got the same thing - I'm leaning towards it being something in the code, but I haven't got the time to experiment and work it out.
I tried it out and got the same thing - I'm leaning towards it being something in the code, but I haven't got the time to experiment and work it out.