Hello!
I have used the makerect code found in other places across this site to make a background image. And I have the setting so that my main MUD window is on the left hand side with 85 characters of length.
In the scripts section, under World Events > Open, I have "!makerect" in the box so that the alias runs whenever the world opens to properly background everything.
However, when the world opens, the mud window is on the top left (as it should be), but only goes down about half the length of the overall window instead of fully to the bottom, as it should. Typing "makerect" corrects this. Any ideas on how to properly set this for the world open?
local background_window = "world_background_image" -- miniwindow ID
-- location for window (and image)
local left = 6
local top = 6
local right = left + GetInfo (213) * 85 -- offset + width for 80 characters
local bottom = GetInfo (280) - 6 -- 15 pixels from bottom
-- tell the client where to draw the text
TextRectangle(left,
top,
right,
bottom,
5, -- BorderOffset,
ColourNameToRGB ("gray"), -- BorderColour,
2, -- BorderWidth,
ColourNameToRGB ("silver"), -- OutsideFillColour,
8) -- OutsideFillStyle (fine hatch)
-- make a miniwindow under the text
check (WindowCreate (background_window, -- window ID
left,
top,
right - left, -- width
bottom - top, -- depth
12, -- center it (ignored anyway)
3, -- draw underneath (1) + absolute location (2)
0x000000)) -- background colour
-- load the background image
--check (WindowLoadImage (background_window, "background", GetInfo (66) .. "bobavader.png"))
-- draw it
--check (WindowDrawImage (background_window, "background", 0, 0, 0, 0, 1)) -- draw it
-- show the window
WindowShow (background_window, true)
SetBackgroundImage("bobavader.png", 2)
|