• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Minimap Icon won't show

Antares

Spell Reviewer
Level 21
Joined
Dec 13, 2009
Messages
509
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: 4
Last edited:

Antares

Spell Reviewer
Level 21
Joined
Dec 13, 2009
Messages
509
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 18
Joined
Oct 17, 2012
Messages
821
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.
 
Top