Could you give me a hint how I would go about blanking it out? I have no clue where to start on something like that or what to use.
How do I blank the whole miniwindow? Wouldn't ReDraw be doing that? I'm quite lost on this.
And what about limiting the redraws like you mentioned? I have no clue about that one either.
Sorry for these newb questions, but I've never coded anything before getting mushclient and have only been at it for a month and a half now, with most of that just being simple things like triggers and aliases then slowly moving on into making plugins up to where I am now trying to make this crazy thing lol.
I don't think the mapper.lua helps any when it comes to dealing with an image.
function zoom_in ()
if last_drawn and ROOM_SIZE < 40 then
ROOM_SIZE = ROOM_SIZE + 2
DISTANCE_TO_NEXT_ROOM = DISTANCE_TO_NEXT_ROOM + 2
build_room_info ()
draw (last_drawn)
end -- if
end -- zoom_in
I deleted one of my posts here as it was just taking up room and irrelevant now. Here's the code so far.
function show_map ()
map_window = GetPluginID()
map_width, map_height = 500, 500
check (WindowCreate (map_window, -- window ID
0, -- left
0, -- top
map_width, -- width
map_height, -- depth
0, -- center it (ignored anyway)
2,
0)) -- background colour
-- load the map image
check (WindowLoadImage (map_window, "map", GetInfo (66) .. "Maps/Woods_Map.png"))
-- draw it
if offset_x == nil and offset_y == nil then
offset_x, offset_y = 0, 0
else
end -- offset check
check (WindowDrawImage (map_window, "map", offset_x, offset_y, 0, 0, 2)) -- draw it
-- drag hotspot
check (WindowAddHotspot(map_window, "map1", 0, 0, map_width,map_height, "", "", "MouseDown", "", "MouseUp", "Drag", 10, 0))
check (WindowDragHandler (map_window, "map1", "dragmove", "", 0))
-- show the window
WindowShow (map_window, true)
end -- show_map
function MouseDown(flags, hotspot_id)
original_x, original_y = GetInfo(283), GetInfo(284)
end -- function MouseDown
function MouseUp(flags, hotspot_id)
offset_x, offset_y = delta_xa, delta_ya
end -- function MouseUp
function dragmove(flags, hotspot_id)
current_x, current_y = GetInfo(283), GetInfo(284)
delta_x, delta_y = current_x-original_x, current_y-original_y
delta_xa, delta_ya = offset_x+delta_x, offset_y+delta_y
WindowTransformImage (map_window, "map", delta_xa, delta_ya, miniwin.image_copy, 1, 0, 0, 1)
Redraw ()
end -- function dragmove
|