Thread Tools Display Modes
04-25-15, 04:33 AM   #1
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
drawing grid and coordinate ?

Hi all ...

Is there an addon or someone that know how to write :-) that giving a GUI element referring to, can draw a grid of lines with the distances written on the border ?

I tried to explain better:

example /addon_name UIParent

and it draws a lot of lines with on X axis -500 ... -60 -40 -20 0 +10 +20 .... +500 and so on ...
Same thing on the Y axis.

Probably we need also the point of application like TOPRIGHT, TOPLEFT, BOTTOM and so on ...

In this way we can better draw and positioning frames for custom interfaces.

Thanks all guys.
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote
04-25-15, 06:43 AM   #2
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,196
There may be more, but the ones I'm familiar with are Align and eAlign Updated.
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Author of NPCScan and many other AddOns.
  Reply With Quote
04-25-15, 09:44 AM   #3
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
Yes, but they actually only draw grid but don't prints the value of X-Y coords relative to the starting point they are relative too.

For example.

If I wants something like:

/addon_name UIParent 'CENTER'


it should prints something like the screenshot I attach (numbers are not probably correct but just to give the idea :-)



But probably the numbers on axis will looks differently if I use something like:

/addon_name UIParent 'TOPLEFT'

The positive Y number will disappears and will not be printed ...

But I really don't know also if the starting params are enough to start ... :-/

BTW, thanks again for attention and for your kind reply.
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote
04-25-15, 10:22 AM   #4
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
I'm not sure what would thoose numbers mean for you, i could suggest you to try out the MoveAnything 2 grid system. Where you can dinamically change the size of the grid with the mousewheel, and print out how many grids are on the verital alignment.
  Reply With Quote
04-25-15, 10:52 AM   #5
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
Probably I am not able to explain well, sorry.

If I have to work with something that involve using an editor to change manually the coords of the frame of an UI usually I have a problem because I am not able to understand at first glance where, i.e:


Lua Code:
  1. cfg.unit_positions = {             
  2.              Player = { a = UIParent,           x= -260, y=  250},




this frame will position itself and then I'll have to do a million of /reload to fix the right position after an edit and save.

This can become a nightmare if you have to do small corrections when you modify some width/height/positions or you have to change drammatically your layout (--> your try and buy process begin again :-)

So if I can read on screen the right number of X,Y probably is simpler.

So I don't need something that move existing things but I need a tool that tell me which coords are where I want to put my frames :-)

Thanks gain to all guys.
Much appreciated.
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote
04-25-15, 11:32 AM   #6
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
I modified Align to add to add grid numbering it's rough and ready and not the actual pixel point of each coord but that could be fixed I'm sure (or just do the math) but I don't use Align much these days.

For creating the horizontal, after tx.SetPoint .. BOTTOMRIGHT .. BOTTOMLEFT I added

Code:
local text = string.gsub(i, "(.)", function(x) return x.."\n" end)
if boxSize < 129 or boxSize > 128 and i%2 ~= 0 then
	lx = grid:CreateFontString(nil, 'OVERLAY') 		
	lx:SetFont("Fonts\\FRIZQT__.TTF", 10)
	lx:SetPoint("BOTTOMLEFT", tx, "BOTTOMLEFT")
	lx:SetText(text)
end
For creating the vertical, After the and of the do statement
Code:
local crud = math.floor((height/2)/hStep)
and after tx:SetPoint .. BOTTOMRIGHT .. TOPRIGHT
Code:
if boxSize > 128 and i%2 == 0 then
	tx:SetTexture(0, 0, 1, 0.5)
end
local counter
if boxSize < 129 or boxSize > 128 and i%2 ~= 0 then
	tx = grid:CreateFontString(nil, 'OVERLAY') 		
	tx:SetFont("Fonts\\FRIZQT__.TTF", 10)
	tx:SetPoint("TOPLEFT", grid, "TOPLEFT", 0, -(height/2+i*hStep) + (size/2))
	counter = crud - i
	tx:SetText(counter)
end
For finer grids is numbrets every second one.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 04-25-15 at 11:40 AM.
  Reply With Quote
04-25-15, 10:09 PM   #7
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
Hi,

I have tried your modifications on align an they works nicely .... but obviusly they ONLY print X/Y relative to BOTTOMLEFT of UIPARENT I suppose.

So probably this approach is too difficult to explore. Let's try to change the scenario to simplify the possible addon:


/addon FRAME 'POINT'

so something like:

/addon UIParent 'TOPLEFT'


and automagically a little cross (or any frame we want) appears writing the coord x,y the mouse is far from UI we specified. So while we move the mouse the coords change.

Should be this simplier ? Any other different tips/idea ?

Thanks.
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.

Last edited by gmarco : 04-25-15 at 10:12 PM.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » drawing grid and coordinate ?

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