Posted by
| Nick Gammon
Australia (23,062 posts) Bio
Forum Administrator |
Message
| And in case it was the juxtaposition of the hotspots, this test creates an array of 100 x 100 of 1x1 hotspots, and that works OK too.
|
To save and install the Hotspot_bug_test2 plugin do this:
- Copy between the lines below (to the Clipboard)
- Open a text editor (such as Notepad) and paste the plugin into it
- Save to disk on your PC, preferably in your plugins directory, as Hotspot_bug_test2.xml
- Go to the MUSHclient File menu -> Plugins
- Click "Add"
- Choose the file Hotspot_bug_test2.xml (which you just saved in step 3) as a plugin
- Click "Close"
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Tuesday, December 22, 2009, 7:29 AM -->
<!-- MuClient version 4.45 -->
<!-- Plugin "Hotspot_bug_test2" generated by Plugin Wizard -->
<muclient>
<plugin
name="Hotspot_bug_test2"
author="Nick Gammon"
id="5a796a8c2d3e5735d5cd1f2d"
language="Lua"
purpose="Tests 100 1x1 hotspots"
date_written="2009-12-22 07:22:57"
requires="4.40"
version="1.0"
>
</plugin>
<!-- Script -->
<script>
<![CDATA[
function mouseover (flags, hotspot_id)
print ("in mouseover, flags=", flags, "hotspot_id=", hotspot_id)
end -- mouseover
function cancelmouseover (flags, hotspot_id)
print ("in cancelmouseover, flags=", flags, "hotspot_id=", hotspot_id)
end -- mouseover
function mousedown (flags, hotspot_id)
print ("in mousedown, flags=", flags, "hotspot_id=", hotspot_id)
end -- mousedown
function cancelmousedown (flags, hotspot_id)
print ("in cancelmousedown, flags=", flags, "hotspot_id=", hotspot_id)
end -- cancelmousedown
function mouseup (flags, hotspot_id)
print ("in mouseup, flags=", flags, "hotspot_id=", hotspot_id)
end -- mousedown
-- make window
win = GetPluginID () -- get a unique name
WindowCreate (win, 0, 0, 200, 200, 12, 0, ColourNameToRGB("white")) -- create window
for y = 0, 99 do
for x = 0, 99 do
-- hotspot location
local LeftA, TopA, RightA, BottomA = x, y, x + 1, y + 1
local id = string.format ("x=%i, y=%i", x, y)
-- fill it
WindowRectOp (win, 2, LeftA, TopA, RightA, BottomA,
bit.bor (
bit.shl (math.random (0, 255), 16),
bit.shl (math.random (0, 255), 8),
math.random (0, 255)))
-- add hotspot
WindowAddHotspot(win, id, LeftA, TopA, RightA, BottomA,
"mouseover",
"cancelmouseover",
"mousedown",
"cancelmousedown",
"mouseup",
"tooltip " .. id,
1, 0)
end -- for x
end -- for y
WindowShow (win, true) -- show it
]]>
</script>
</muclient>
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|