Thread Tools Display Modes
08-14-05, 10:56 AM   #1
Corwyn
A Murloc Raider
 
Corwyn's Avatar
Join Date: Jun 2005
Posts: 5
In regards to mini-map buttons

How would one go about rotating them around the minimap? All my addons seem to want to put their button in the same general place, meaning several get lost beneath the jumble. Help?
__________________
Spaghetti Code - 0 net carbs.
  Reply With Quote
08-14-05, 11:52 AM   #2
Cairenn
Credendo Vides
 
Cairenn's Avatar
Premium Member
WoWInterface Admin
Join Date: Mar 2004
Posts: 7,134
Most have an option to move the button. Try right-clicking on the ones you can see, check for an "options", click on that, and see if there is a slider to move the icon.
__________________
“Do what you feel in your heart to be right — for you’ll be criticized anyway.” ~ Eleanor Roosevelt
~~~~~~~~~~~~~~~~~~~
Co-Founder & Admin: MMOUI
FaceBook Profile, Page, Group
Avatar Image by RaffaeleMarinetti
  Reply With Quote
08-14-05, 11:53 AM   #3
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
er edit: oops, misread from what angle. 99.9% use a slider in options. I personally prefer dragging the button itself.

This is a way to make the icon draggable:

1. Add a small frame that exists to start/stop OnUpdates when dragging:

<Frame name="MyModIconDraggingFrame" hidden="true">
<Scripts>
<OnUpdate>
MyMod_DragMinimapIcon()
</OnUpdate>
</Scripts>
</Frame>

2. Add these to the <Scripts> of the minimap icon's frame (this=MyModIconFrame for example):

<OnLoad>
this:RegisterForDrag("LeftButton")
</OnLoad>

<OnDragStart>
this:LockHighlight()
this:StartMoving() -- only to register in layout-cache.txt
this:StopMovingOrSizing()
MyModIconDraggingFrame:Show()
</OnDragStart>
<OnDragStop>
MyModIconDraggingFrame:Hide()
this:UnlockHighlight()
</OnDragStop>

3. Add the OnUpdate function in the lua:

function MyMod_DragMinimapIcon()
local xpos,ypos = GetCursorPosition()
local xmin,ymin = Minimap:GetLeft(), Minimap:GetBottom()
xpos = xmin-xpos/UIParent:GetScale()+70
ypos = ypos/UIParent:GetScale()-ymin-70
local angle = math.deg(math.atan2(ypos,xpos))
MyModIconFrame:SetPoint("TOPLEFT","Minimap","TOPLEFT",52-(80*cos(angle)),(80*sin(angle))-52)
end

--
For the mod makers: No slider to initialize, and nothing to SavedVariable since we let layout-cache.txt keep its place for us.
For the user: no poking around in options. They just grab the button and drag.
  Reply With Quote
08-14-05, 01:04 PM   #4
Corwyn
A Murloc Raider
 
Corwyn's Avatar
Join Date: Jun 2005
Posts: 5
Thanks alot
__________________
Spaghetti Code - 0 net carbs.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » In regards to mini-map buttons


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