View Single Post
07-26-18, 10:43 PM   #1
Theroxis
A Fallenroot Satyr
Join Date: Jun 2018
Posts: 24
Minimap won't move to edge of screen with mask

So, I've gone ahead and created an alpha mask for my Minimap to make it rectangular, this works great.
I then wrote some lua to adjust the position of elements on the minimap, such as the mail icon, zone text, and clock. I also adjusted the hitbox of the minimap to match the new minimap shape, with the rectangular alpha map.
Finally, I went to adjust the minimap into the final desired location on screen... And it doesn't budge. The other elements work perfectly, just not the minimap itself.
Code:
--===============================================================================--
--MINIMAP TWEAKS: Rectangle, aesthetics
--===============================================================================--

function GetMinimapShape() return 'SQUARE' end
Minimap:SetFrameLevel(8)
Minimap:SetSize(280, 280)
MinimapBorderTop:Hide()
MinimapBorder:Hide()
Minimap:SetMaskTexture('Interface\\Addons\\UITweaks\\media\\mapmask')
Minimap:SetHitRectInsets(0, 0, 58, 58)
Minimap:ClearAllPoints()
Minimap:SetPoint("TOPRIGHT",UIParent,-5,50)
MinimapZoneText:SetWidth(Minimap:GetWidth()*0.9)
MinimapZoneText:ClearAllPoints()
MinimapZoneText:SetPoint("TOP",Minimap,"TOP",0,-60)
MinimapBackdrop:Hide()
MinimapBorder:Hide()
MinimapBorderTop:Hide()
MinimapZoomIn:Hide()
MinimapZoomOut:Hide()
GameTimeFrame:Hide()
MiniMapTracking:Hide()
MiniMapMailBorder:Hide()
MinimapNorthTag:SetAlpha(0)
MiniMapInstanceDifficulty:SetAlpha(0)
GuildInstanceDifficulty:SetAlpha(0)
MiniMapMailFrame:ClearAllPoints()
MiniMapMailFrame:SetPoint("BOTTOMLEFT",Minimap,"BOTTOMLEFT",-5,53)
MiniMapMailFrame:SetAlpha(0.8)


local blanktex = "Interface\\Buttons\\WHITE8x8"
local insetsize = 1 -- This is so you can perform arithmetic on the border size to configure the inset size.
local backdropcolor = {26/255, 25/255, 31/255}		-- backdrop color
local brdcolor = {0/255, 0/255, 0/255}				-- backdrop border color

BorderFrame = CreateFrame("Frame", nil, UIParent)
BorderFrame:SetPoint("TOPLEFT", Minimap, "TOPLEFT", -1, -(58))
BorderFrame:SetPoint("BOTTOMRIGHT", Minimap, "BOTTOMRIGHT", 1, (58))	
BorderFrame:SetBackdrop(backdrop)
if not classColoredBorder then
	BorderFrame:SetBackdropBorderColor(unpack(brdcolor))
else
	BorderFrame:SetBackdropBorderColor(color.r, color.g, color.b)
end	
BorderFrame:SetBackdropColor(unpack(backdropcolor))
BorderFrame:SetFrameLevel(6)
Here's the situation, graphically:
https://imgur.com/a/WrmRkxg

The only change between those two screenshots is on this line:
Code:
Minimap:SetPoint("TOPRIGHT",UIParent,-5,50)

I've looked at other addons that provide a rectangular minimap and they don't seem to be doing anything special. I haven't tested that any of them exhibit the same behavior or not, though. It's like the minimap is bound on-screen for some reason and I can't figure out why... Any suggestions to fix this?

Last edited by Theroxis : 07-26-18 at 10:47 PM.
  Reply With Quote