View Single Post
08-02-12, 12:22 AM   #1
Qupe
A Warpwood Thunder Caller
 
Qupe's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 92
Rectangle Minimap

I'm trying to recreate Dawn's rectangle minimap.

Before straight up copy/pasting his code, I hack'n'slashed it by setting the size. This worked but ended up stretching the map's textures.

ex:


Went ahead and copy/pasted code in and got this:



code:
Lua Code:
  1. -----------
  2. -- style --
  3. -----------
  4. local _, class = UnitClass('player')
  5. local color = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[class] or RAID_CLASS_COLORS[class]           
  6.  
  7. Minimap:SetSize(172*scale, 172*scale)
  8. Minimap:SetMaskTexture(mediaFolder.."rectangle")
  9. Minimap:SetHitRectInsets(0, 0, 24*scale, 24*scale)
  10. Minimap:SetFrameLevel(4)
  11. Minimap:ClearAllPoints()
  12. Minimap:SetPoint(position, UIParent, position_x, position_y)
  13. Minimap:SetScale(scale)
  14.  
  15. --LFDSearchStatus:SetClampedToScreen(true)
  16.  
  17. BorderFrame = CreateFrame("Frame", nil, Minimap)
  18. BorderFrame:SetPoint("TOPLEFT", Minimap, "TOPLEFT", -1, -(21*scale))
  19. BorderFrame:SetPoint("BOTTOMRIGHT", Minimap, "BOTTOMRIGHT", 1, (21*scale)) 
  20. BorderFrame:SetBackdrop(backdrop)
  21. if not classColoredBorder then
  22.     BorderFrame:SetBackdropBorderColor(unpack(brdcolor))
  23. else
  24.     BorderFrame:SetBackdropBorderColor(color.r, color.g, color.b)
  25. end
  26. BorderFrame:SetBackdropColor(unpack(backdropcolor))
  27. BorderFrame:SetFrameLevel(6)

I understand the general gist of how the mask is covering the bits of the map, making it a "rectangle" without stretching the actual map texture.

What I don't understand is why a) it's green and b) the top/bottom bits of the map aren't being masked.

This is the addon I'm trying to recreate:
http://www.wowinterface.com/download...0-dRecMap.html

I don't think I missed any code or stuff that is actually masking the map (I didn't include the config code at the top of the addon that sets stuff like bg textures, scale, etc...).

I attached the entirety of the code; the lua file is basically Dawn's map with stuff commented out that errors. I don't intend to use anything from that code besides what styles the map, so just disregard any of the out of date stuff.

Basically, is it still possible to do this? If it is, has something changed which makes the styling in this addon non-functional?

Thanks!
Attached Files
File Type: lua Minimap.lua (5.8 KB, 515 views)
__________________
Quse UI
WoW :: EQ2
  Reply With Quote