Thread Tools Display Modes
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
07-27-18, 03:12 AM   #2
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Have you checked the MinimapCluster via /fstack?
The cluster is parenting the Minimap.

Here is what I am doing with rMinimap. I use my own minimap mask too.
https://github.com/zorker/rothui/blo...p/core.lua#L29
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
07-27-18, 08:22 AM   #3
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
The cluster should not affect the placement of the minimap if the position is being changed.

OP: You changed everything you could see, but you forget that the minimap is actually still a square, and is set to not go off-screen.

You can either turn that off, or allow it to go off by a predetermined amount.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
07-27-18, 10:48 AM   #4
Theroxis
A Fallenroot Satyr
Join Date: Jun 2018
Posts: 24
Originally Posted by zork View Post
Have you checked the MinimapCluster via /fstack?
The cluster is parenting the Minimap.

Here is what I am doing with rMinimap. I use my own minimap mask too.
https://github.com/zorker/rothui/blo...p/core.lua#L29
Originally Posted by Seerah View Post
The cluster should not affect the placement of the minimap if the position is being changed.

OP: You changed everything you could see, but you forget that the minimap is actually still a square, and is set to not go off-screen.

You can either turn that off, or allow it to go off by a predetermined amount.
Thanks for the help,
Moving the Minimap frame also moves the cluster frame, which is revealed by fstack appropriately. I also used /run print(Minimap:IsClampedToScreen()) as well as /run print(MinimapCluster:IsClampedToScreen()) which both return false. I went ahead and set the clamp rects appropriately (negative 58 on top and bottom to match the mask, 0 on left and right) anyways, as well as trying Minimap:SetClampedToScreen(false) and MinimapCluster:SetClampedToScreen(false), with no impact.

I also tried setting the parent of Minimap to WorldFrame instead of UIParent, but that just messed with the scale inheritance and nothing else.

I'll zip up just the minimap portion of this so people can play with it if they like, but it seems like I am limited to the constraints of the mask texture no matter what I try. For now I will settle for a stretched minimap that I can position where I want. It looks uglier, but at least it fits. This might be a limitation of the game engine, at this point.


Here's a link to what I have right now ( A bit ugly admittedly but I've been throwing the kitchen sink at it lol):
https://drive.google.com/open?id=1tW...VE4Qs4kD8bTSt7
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Minimap won't move to edge of screen with mask

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off