Hey friends,
I've been stuck on this same issue for about five years and still can't solve it..
I am trying to draw an image with a transparent background (alpha) into a hidden miniwindow, then copy it over to another miniwindow and stretch it. OR, draw it stretched into a hidden miniwindow, and then draw it using WindowDrawImageAlpha into another window. I've basically tried every combination I can think of, doing things like that...
I basically
1. Create the hidden miniwindow
2. Resize the hidden miniwindow
3. Draw the alpha image
4. Transfer it to the other window
5. Draw the image stretched.
I have tried by using step 5 as 3 and 3 as 5, and I have tried by using WindowTransformImage as well after the resize/draw, and before the final draw.
I've tried everything I can possibly imagine..
I've also printed the colors to myself to figure out where I'm going wrong..
FIRST PRINT BEFORE RESIZE: 0
PRINT AFTER ALPHA DRAW: 32768
PRINT BEFORE DRAWING: 41754
AFTER THE DRAW: 32768
The final image still has a green background..
Seen here:
https://cdn.discordapp.com/attachments/660703844967251973/1036930462825852938/unknown.png
If I Just use it will draw the image how it should, without the background color, but it won't be stretched...
Seen here
https://cdn.discordapp.com/attachments/660703844967251973/1036930742149726209/unknown.png
I need to do both..
I am trying to draw an image, in this case a CHEST, over a room in my mapper. This would work with all of the other icons I wish to draw as well.
PLEASE HELP!
I've been stuck on this same issue for about five years and still can't solve it..
I am trying to draw an image with a transparent background (alpha) into a hidden miniwindow, then copy it over to another miniwindow and stretch it. OR, draw it stretched into a hidden miniwindow, and then draw it using WindowDrawImageAlpha into another window. I've basically tried every combination I can think of, doing things like that...
if WindowInfo("hiddenWindow", 4) == nil then
--DebugNote("No hidden window, creating it now!")
WindowCreate (hiddenWindow, 0, 0, 0, 0, 12, 3, ColourNameToRGB("green"))
end
-- lets check if its a chest
chestX = GetPluginVariable("b6eae87ccedd84f510b74714", "chestLocationX") or nil
chestY = GetPluginVariable("b6eae87ccedd84f510b74714", "chestLocationY") or nil
if tonumber(chestX) ~= nil and tonumber(chestY) ~= nil and tonumber(room.x) ~= nil and tonumber(room.y) ~= nil then
if tonumber(room.x) == tonumber(chestX) and tonumber(room.y) == tonumber(chestY) then
alphaImageId = "chest"
chestPath = "worlds\plugins\images\chest.png"
if WindowLoadImage (hiddenWindow, alphaImageId, chestPath) == 0 then
WindowResize (hiddenWindow, WindowImageInfo(hiddenWindow, alphaImageId, 2), WindowImageInfo(hiddenWindow, alphaImageId, 3), ColourNameToRGB("green")) -- resizes the miniwindow with a green background: wish i could just do NO color, heh
WindowDrawImageAlpha(hiddenWindow, alphaImageId, 0, 0, 0, 0, 1) -- draws the chest with 100% opacity, withn alpha layer in tact.
WindowImageFromWindow(win, alphaImageId, hiddenWindow) -- grabs the chest from hiddenWindow
WindowDrawImage (win, alphaImageId, left, top, right, bottom, 2) -- draws the chest
end
end
end
I basically
1. Create the hidden miniwindow
2. Resize the hidden miniwindow
3. Draw the alpha image
4. Transfer it to the other window
5. Draw the image stretched.
I have tried by using step 5 as 3 and 3 as 5, and I have tried by using WindowTransformImage as well after the resize/draw, and before the final draw.
I've tried everything I can possibly imagine..
I've also printed the colors to myself to figure out where I'm going wrong..
FIRST PRINT BEFORE RESIZE: 0
PRINT AFTER ALPHA DRAW: 32768
PRINT BEFORE DRAWING: 41754
AFTER THE DRAW: 32768
The final image still has a green background..
Seen here:
https://cdn.discordapp.com/attachments/660703844967251973/1036930462825852938/unknown.png
If I Just use
WindowDrawImage (win, alphaImageId, left, top, right, bottom, 3)Seen here
https://cdn.discordapp.com/attachments/660703844967251973/1036930742149726209/unknown.png
I need to do both..
I am trying to draw an image, in this case a CHEST, over a room in my mapper. This would work with all of the other icons I wish to draw as well.
PLEASE HELP!
