• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Minimap Icon won't show

Status
Not open for further replies.
Hello,

I don't know what I'm doing wrong. I'm trying to display an icon on the minimap with:

JASS:
set newPowerup.indicator = CreateMinimapIcon( x , y , 255 , 255 , 255 , "Minimap01.blp" , FOG_OF_WAR_VISIBLE )
call SetMinimapIconVisible( newPowerup.indicator , true )

The icon is 16x16. It has a 1 pixel transparent border. I've tried blp1, blp2, dds, and tga. None of them work. What's wrong with this icon?
 

Attachments

  • Minimap01.png
    Minimap01.png
    785 bytes · Views: 10
Last edited:
I've decided that I'm not dealing with this crap and I'm just gonna use frames instead. For anyone googling this in the future, here is some code to correctly position the icon on the minimap:

JASS:
globals
       constant real CAMERA_BOUND_RIGHT = ?
       constant real CAMERA_BOUND_LEFT = ?
       constant real CAMERA_BOUND_TOP = ?
       constant real CAMERA_BOUND_BOTTOM = ?
endglobals

function CreateIconOnMinimap takes real x, real y, string whichIcon returns framehandle
        local real xR
        local real yR
        local real maxMinimapDist = RMaxBJ(CAMERA_BOUND_RIGHT - CAMERA_BOUND_LEFT + 768 , CAMERA_BOUND_TOP - CAMERA_BOUND_BOTTOM + 512)/2
        local real xCenter = (CAMERA_BOUND_RIGHT + CAMERA_BOUND_LEFT)/2
        local real yCenter = (CAMERA_BOUND_TOP + CAMERA_BOUND_BOTTOM)/2
        local frame iconFrame = BlzCreateFrameByType("BACKDROP", "whateverName" , BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)
     
        set xR = (x - xCenter)/maxMinimapDist
        set yR = (y - yCenter)/maxMinimapDist

        call BlzFrameSetSize(iconFrame , 0.0083, 0.0083)
        call BlzFrameSetAbsPoint( iconFrame , FRAMEPOINT_CENTER , 0.080 + 0.067*xR , 0.077 + 0.069*yR )
        call BlzFrameSetTexture( iconFrame , whichIcon , 0 , true )
        call BlzFrameSetVisible( iconFrame , true )
        call BlzFrameSetEnable( iconFrame , false )
        return iconFrame
endfunction
 
Last edited:
Level 19
Joined
Oct 17, 2012
Messages
860
The reason that function takes a model is probably due to the fact that minimap icons are billboarded models.

Would it not be a hell lot easier if you set the position of your custom frame relative to the actual minimap frame - ORIGIN_FRAME_MINIMAP? Then you won't have to deal with all that camera crap.
 
Status
Not open for further replies.
Top