call SetUnitVertexColor(whichUnit, red, green, blue, alpha)
call SetUnitVertexColor(u, 255, 255, 255, 127)
u
50% transparent.This function only hides the unit, the shadow remains.
function CreateUnitAndGetShadow takes nothing returns image
// Handle id of this image is now 0
local image i = CreateImage("dummy.blp", 64, 64, 0, 0, 0, 0, 64, 64, 0, 3)
// Image destroyed, i points to 0
call DestroyImage(i)
// This unit will also create an image (it's shadow)
// This shadow will have a Handle Id of 0
// i points to an image with Id 0
call CreateUnit(...)
// Thus i is now the actual shadow of the unit ^_^
return i
endfunction
native CreateImage takes string file, real sizeX, real sizeY, real sizeZ, real posX, real posY, real posZ, real originX, real originY, real originZ, integer imageType returns image
native DestroyImage takes image whichImage returns nothing
native ShowImage takes image whichImage, boolean flag returns nothing
native SetImageConstantHeight takes image whichImage, boolean flag, real height returns nothing
native SetImagePosition takes image whichImage, real x, real y, real z returns nothing
native SetImageColor takes image whichImage, integer red, integer green, integer blue, integer alpha returns nothing
native SetImageRender takes image whichImage, boolean flag returns nothing
native SetImageRenderAlways takes image whichImage, boolean flag returns nothing
native SetImageAboveWater takes image whichImage, boolean flag, boolean useWaterAlpha returns nothing
native SetImageType takes image whichImage, integer imageType returns nothing
the function posted above can't do this.
native ShowImage takes image whichImage, boolean flag returns nothing
native SetUnitVertexColor takes unit whichUnit, integer red, integer green, integer blue, integer alpha returns nothing
call CreateUnit( Player(0), 'hfoo', 0, 0, 270 )
set UnitShadow = bj_lastCreatedImage
call CreateUnit( Player(0), 'hfoo', 0, 0, 270 )
call DestroyImage( bj_lastCreatedImage )
//Show the Shadow
call SetImageColor( UnitShadow , 255, 255, 255, 255 )
//Hide the Shadow
call SetImageColor( UnitShadow , 0, 0, 0, 0 )