Download
(1Kb)
Download
Updated: 10-08-12 02:48 PM
Pictures
File Info
Updated:10-08-12 02:48 PM
Created:unknown
Downloads:338,917
Favorites:1,650
MD5:

Align  Popular! (More than 5000 hits)

Version: 1.10
by: Akeru [More]

Very simple and light addon that creates a grid on your screen to aid you in aligning and centering your UI. Align is totally resolution independent, and will create even grids no matter how you play.

I will consider any minor tweaks or updates submitted, but nothing that exceeds the small scope of the addon.

Default Toggle: /align

To change the grid size, type the number after the slash command.

Available options:

/align 32
/align 64
/align 128
/align 256

If the addon ever appears outdated in a future patch, it should continue to work if enabled manually in your addon options. If this is not the case, please let me know.

Enjoy!

Huge thanks to Tuller, Nymbia, Neronix, Antiarc and Haste for their help and code!


Current:
Align 1.10 - Updating TOC to reflect compatibility. Nothing changed. Works great in 5.0.4!

Post A Reply Comment Options
Unread 05-08-20, 06:42 AM  
lanacan
A Warpwood Thunder Caller
 
lanacan's Avatar
AddOn Author - Click to view AddOns

Forum posts: 94
File comments: 177
Uploads: 13
To get this to work in 8.3

Open Align.lua in Notepad++ and do a find/replace to change "SetTexture" to "SetColorTexture", this will make the lines show in the UI.
__________________
Busy modifying your code for my own UI.
Report comment to moderator  
Reply With Quote
Unread 01-02-18, 10:58 AM  
Listra
A Murloc Raider

Forum posts: 8
File comments: 38
Uploads: 0
Question Only shows cross in the middle

Hi there,

Maybe it's the 4K resolution that bug's with the add on, but I can't get it to show any grid.
Anyone else tried with high res?
Report comment to moderator  
Reply With Quote
Unread 08-04-16, 08:58 AM  
mfrnka
Premium Member

Forum posts: 26
File comments: 20
Uploads: 0
Thanks for the code update. Much appreciated!
Report comment to moderator  
Reply With Quote
Unread 07-19-16, 08:15 PM  
Benea
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 18
File comments: 87
Uploads: 1
Thanks! Have used this for many years.
Report comment to moderator  
Reply With Quote
Unread 05-16-16, 03:33 PM  
Soapnrope
A Kobold Labourer

Forum posts: 0
File comments: 1
Uploads: 0
If anyone looking for Legion Beta version:
Code:
local grid
local boxSize = 32

function Grid_Show()
	if not grid then
        Grid_Create()
	elseif grid.boxSize ~= boxSize then
        grid:Hide()
        Grid_Create()
    else
		grid:Show()
	end
end

function Grid_Hide()
	if grid then
		grid:Hide()
	end
end

local isAligning = false

SLASH_TOGGLEGRID1 = "/align"
SlashCmdList["TOGGLEGRID"] = function(arg)
    if isAligning then
        Grid_Hide()
        isAligning = false
    else
        boxSize = (math.ceil((tonumber(arg) or boxSize) / 32) * 32)
    if boxSize > 256 then boxSize = 256 end    
        Grid_Show()
        isAligning = true
    end
end

function Grid_Create() 
	grid = CreateFrame('Frame', nil, UIParent) 
	grid.boxSize = boxSize 
	grid:SetAllPoints(UIParent) 

	local size = 2 
	local width = GetScreenWidth()
	local ratio = width / GetScreenHeight()
	local height = GetScreenHeight() * ratio

	local wStep = width / boxSize
	local hStep = height / boxSize

	for i = 0, boxSize do 
		local tx = grid:CreateTexture(nil, 'BACKGROUND') 
		if i == boxSize / 2 then 
			tx:SetColorTexture(1, 0, 0, 0.5) 
		else 
			tx:SetColorTexture(0, 0, 0, 0.5) 
		end 
		tx:SetPoint("TOPLEFT", grid, "TOPLEFT", i*wStep - (size/2), 0) 
		tx:SetPoint('BOTTOMRIGHT', grid, 'BOTTOMLEFT', i*wStep + (size/2), 0) 
	end 
	height = GetScreenHeight()
	
	do
		local tx = grid:CreateTexture(nil, 'BACKGROUND') 
		tx:SetColorTexture(1, 0, 0, 0.5)
		tx:SetPoint("TOPLEFT", grid, "TOPLEFT", 0, -(height/2) + (size/2))
		tx:SetPoint('BOTTOMRIGHT', grid, 'TOPRIGHT', 0, -(height/2 + size/2))
	end
	
	for i = 1, math.floor((height/2)/hStep) do
		local tx = grid:CreateTexture(nil, 'BACKGROUND') 
		tx:SetColorTexture(0, 0, 0, 0.5)
		
		tx:SetPoint("TOPLEFT", grid, "TOPLEFT", 0, -(height/2+i*hStep) + (size/2))
		tx:SetPoint('BOTTOMRIGHT', grid, 'TOPRIGHT', 0, -(height/2+i*hStep + size/2))
		
		tx = grid:CreateTexture(nil, 'BACKGROUND') 
		tx:SetColorTexture(0, 0, 0, 0.5)
		
		tx:SetPoint("TOPLEFT", grid, "TOPLEFT", 0, -(height/2-i*hStep) + (size/2))
		tx:SetPoint('BOTTOMRIGHT', grid, 'TOPRIGHT', 0, -(height/2-i*hStep + size/2))
		
	end
	
end
Report comment to moderator  
Reply With Quote
Unread 07-25-15, 08:21 AM  
vikkyne
A Murloc Raider

Forum posts: 4
File comments: 114
Uploads: 0
After all these years, this is still one of the addons I always make sure I have installed.

Thanks!
Report comment to moderator  
Reply With Quote
Unread 10-08-12, 02:50 PM  
Akeru
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 12
Uploads: 1
Originally Posted by Daagar
Looks like the current version might be packaged incorrectly. Typically, addons are packed in a folder of the same name:

align/
align.toc
file2.txt
file3.txt

This doesn't have the top-level 'align' folder. Not a huge issue, but might break things like mmoui.
Thanks. Fixed the zip.
Report comment to moderator  
Reply With Quote
Unread 10-07-12, 10:23 AM  
Daagar
An Aku'mai Servant

Forum posts: 35
File comments: 59
Uploads: 0
Looks like the current version might be packaged incorrectly. Typically, addons are packed in a folder of the same name:

align/
align.toc
file2.txt
file3.txt

This doesn't have the top-level 'align' folder. Not a huge issue, but might break things like mmoui.
Report comment to moderator  
Reply With Quote
Unread 10-06-12, 03:15 PM  
Kyplor
A Murloc Raider

Forum posts: 4
File comments: 26
Uploads: 0
Thanks for the update.

I like running 64 grid so much, I changed line 2 of the lua from 32 to 64.
Report comment to moderator  
Reply With Quote
Unread 07-29-12, 07:01 PM  
wolftech
A Deviate Faerie Dragon

Forum posts: 14
File comments: 62
Uploads: 0
This works fine in MoP Beta/PTR (thank the addon gods... I couldn't build a UI without this and Addon Control Panel )
Report comment to moderator  
Reply With Quote
Unread 07-09-12, 07:06 AM  
JCinDE
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 11
Uploads: 1
Suggestion: Whiteout

/align white

This would provide a white background behind the grid making it much easier to see the grid and UI element edges on busy or dark backgrounds. Basically white-out the world frame so you don't have to look around Orgrimmar or Stormwind for a patch of bright colors to stare at while you fiddle with your UI.
Report comment to moderator  
Reply With Quote
Unread 12-20-10, 07:56 PM  
LippyPantaloons
A Murloc Raider

Forum posts: 8
File comments: 8
Uploads: 0
Align interferes with Stuf and PB4 transparancies

I have no idea why, but Align seems to disable my ability to change transparency settings for borders and backgrounds in both Stuf and PB4. They work fine without align, and when I enable align they cannot be changed.

I am not positive of the causation but it seems connected.
Report comment to moderator  
Reply With Quote
Unread 11-01-10, 10:57 AM  
markhr
A Fallenroot Satyr

Forum posts: 23
File comments: 43
Uploads: 0
LDB button?

Is there a ldb button for this that I can click to set sizing and toggle on/off? Preferably that works with titan panel.
Report comment to moderator  
Reply With Quote
Unread 10-16-10, 04:48 PM  
ricks322
A Chromatic Dragonspawn
AddOn Author - Click to view AddOns

Forum posts: 154
File comments: 153
Uploads: 1
Just a note, this is working just fine with 4.01, and also on the Cata beta 4.03.
Report comment to moderator  
Reply With Quote
Unread 04-14-10, 12:59 AM  
blakex
A Kobold Labourer

Forum posts: 0
File comments: 1
Uploads: 0
Originally posted by Ploedman
Can you maybe update your addon
Just go in to Align.toc and change the first line Interface: 30200 to 30300 and it will work without having to turn on out-of-date addons.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: