One of my friends did this thing, but they had to create 3 miniwindows to test it. This should be testable by you.
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Friday, August 14, 2009, 6:13 AM -->
<!-- MuClient version 4.43 -->
<muclient>
<plugin
name="ChestTest"
id="08fffaaa11346af04a1be9e3"
language="Lua"
purpose="Display mobs in room."
save_state="y"
requires="4.43"
version="1.1"
>
<description trim="y">
<![CDATA[
]]>
</description>
</plugin>
<!-- Get our standard constants -->
<include name="constants.lua"/>
<!-- Triggers -->
<triggers>
</triggers>
<!-- Aliases -->
<aliases>
</aliases>
<!-- Script -->
<script>
<![CDATA[
-- Options -----------------------------------------------
function OnPluginInstall ()
hiddenWindow = "hiddenWindow"
visibleWindow = "visibleWindow"
alphaMaskWindow = "alphaWindow"
alphaImageId = "chest"
betaImageId = "beta"
treeImageId = "tree"
-- Stretch the chest in a hidden window
WindowCreate (hiddenWindow, 100, 500, 64, 64, 12, 2, ColourNameToRGB("black"))
WindowLoadImage (hiddenWindow, alphaImageId, "chest.png")
WindowDrawImage(hiddenWindow, alphaImageId, 0, 0, 64, 64, 2, 0, 0, 32, 32)
-- Draw an unstretched alpha mask in a hidden window using the chest
WindowCreate(alphaMaskWindow, 100, 50, 32, 32, 12, 2, ColourNameToRGB("red"))
WindowLoadImage (alphaMaskWindow, alphaImageId, "chest.png")
WindowGetImageAlpha(alphaMaskWindow, alphaImageId, 0, 0, 32, 32, 0, 0);
--long WindowDrawImage(BSTR WindowName, BSTR ImageId, long Left, long Top, long Right, long Bottom, short Mode, long SrcLeft, long SrcTop, long SrcRight, long SrcBottom);
-- Stretch the alpha mask in a hidden window
WindowCreate("alphaMaskWindowStretched",100,300, 64, 64, 12, 2, ColourNameToRGB("green"))
WindowImageFromWindow("alphaMaskWindowStretched", "alphaMaskId", alphaMaskWindow);
WindowDrawImage("alphaMaskWindowStretched", "alphaMaskId", 0, 0, 64, 64, 2)
-- just for debugging, show the windows so we know whats inside
WindowShow(alphaMaskWindow, true)
WindowShow("alphaMaskWindowStretched", true)
WindowShow (hiddenWindow, true)
WindowLoadImage (visibleWindow, alphaImageId, "chest.png")
WindowLoadImage (visibleWindow, treeImageId, "cave.png")
WindowCreate (visibleWindow, 250, 0, 300, 300, 12, 10, ColourNameToRGB("white"))
WindowTransformImage(visibleWindow, treeImageId, 0, 0, 3, 2, 0, 0, 2);
WindowTransformImage(visibleWindow, treeImageId, 64, 0, 3, 2, 0, 0, 2);
WindowTransformImage(visibleWindow, treeImageId, 128, 0, 3, 2, 0, 0, 2);
WindowTransformImage(visibleWindow, treeImageId, 192, 0, 3, 2, 0, 0, 2);
WindowTransformImage(visibleWindow, treeImageId, 0, 64, 3, 2, 0, 0, 2);
WindowTransformImage(visibleWindow, treeImageId, 64, 64, 3, 2, 0, 0, 2);
WindowTransformImage(visibleWindow, treeImageId, 128, 64, 3, 2, 0, 0, 2);
WindowTransformImage(visibleWindow, treeImageId, 192, 64, 3, 2, 0, 0, 2);
WindowTransformImage(visibleWindow, treeImageId, 0, 128, 3, 2, 0, 0, 2);
WindowTransformImage(visibleWindow, treeImageId, 64, 128, 3, 2, 0, 0, 2);
WindowTransformImage(visibleWindow, treeImageId, 128, 128, 3, 2, 0, 0, 2);
WindowTransformImage(visibleWindow, treeImageId, 192, 128, 3, 2, 0, 0, 2);
WindowTransformImage(visibleWindow, treeImageId, 0, 192, 3, 2, 0, 0, 2);
WindowTransformImage(visibleWindow, treeImageId, 64, 192, 3, 2, 0, 0, 2);
WindowTransformImage(visibleWindow, treeImageId, 128, 192, 3, 2, 0, 0, 2);
WindowTransformImage(visibleWindow, treeImageId, 192, 192, 3, 2, 0, 0, 2);
WindowImageFromWindow(visibleWindow, betaImageId, hiddenWindow)
-- 10,20 - positions, 3 = transparent
-- WindowTransformImage(visibleWindow, betaImageId, 64, 128, 3, 3, 0, 0, 3);
WindowDrawImage (visibleWindow, alphaImageId, 64, 64, 0, 0, 1)
WindowImageFromWindow(visibleWindow, "alphaMaskId", alphaMaskWindow);
WindowImageFromWindow(visibleWindow, "alphaImageId", hiddenWindow);
WindowImageFromWindow(visibleWindow, "alphaMaskStretchedId", "alphaMaskWindowStretched")
WindowMergeImageAlpha(visibleWindow, alphaImageId, "alphaMaskId", 128, 128, 192, 192, 0, 1, 0, 0, 0, 0);
-- This is the one that works
WindowMergeImageAlpha(visibleWindow, "alphaImageId", "alphaMaskStretchedId", 64, 128, 128, 192, 0, 1, 0, 0, 0, 0);
WindowShow (visibleWindow, true)
end -- OnPluginInstall
]]></script>
</muclient>
This was their accompanying image
https://media.discordapp.net/attachments/1007181616529035334/1037551185625886791/Screen_Shot_2022-11-02_at_7.17.43_PM.png?width=459&height=586
They told me they had to create 3 windows to make it work as intended, which is unideal, so I should probably try sticking with using WindowTransformImage and calculating the zoom levels, etc, which is fine but I'm just thinking couldn't there be an option added to WindowDrawImage or WindowDrawImageAlpha that just draws stretched and alpha, or is this insanely complicated?
btw, cave image can be found here
https://github.com/AsmodeusBrooding/Aardwolf/blob/main/GraphicalMapper/images/cave.png |