• 🏆 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!

[1.31.1] UI: Moved minimap problems

Status
Not open for further replies.
Level 10
Joined
Dec 11, 2009
Messages
234
So I want to move the minimap to top-left corner of the screen (staying within 4:3 bounds, ofc).
I successfully moved the model itself with the following code, but here is the problem:
It seems that interactable frame-area didn't move (where it gets the click coordinates and stuff), and this is what I get as a result:
BuggedMinimap.gif

JASS:
function test()
    local framehandle minimap = BlzGetOriginFrame(ORIGIN_FRAME_MINIMAP, 0)
    BlzFrameClearAllPoints(minimap)
    // war3mapMap.blp is 256x256 pixels
    BlzFrameSetAbsPoint(minimap, FRAMEPOINT_TOPRIGHT,   0. + 256.*px2dpi(), 0.4 + 256.*px2dpi())
    BlzFrameSetAbsPoint(minimap, FRAMEPOINT_BOTTOMLEFT, 0., 0.4)
endfunction

function px2dpi() returns real
    return 0.6/_localResolutionHeight
endfunction

// function dpi2px() returns real
//     return _localResolutionHeight/0.6
// endfunction

function onInit()
    _localResolutionWidth  = BlzGetLocalClientWidth()
    _localResolutionHeight = BlzGetLocalClientHeight()
endfunction
I'm using 1.31.1.
What am I doing wrong?
 
Status
Not open for further replies.
Top