Thread Tools Display Modes
08/17/14, 07:44 AM   #1
Dingodan
 
Dingodan's Avatar
Join Date: Apr 2014
Posts: 50
Grid

It would be great if someone could make an addon with keybind for toggle to show an grid all over the screen to align addon ui's.
Like this
  Reply With Quote
08/23/14, 10:34 AM   #2
skyraker
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 154
I'm going to try to do something like this as a way to learn a little bit about textures and photo editing. I would assume it would encompass things like:
  1. Getting current screen size
  2. dividing screen by grid block size
  3. dynamically creating required number of blocks
  4. displaying grid as lowest possible layer
  5. possibly allowing block size modification

As I said, the hard part for me will be actually getting a texture made right and put into the addon correctly. Most of the rest I shouldn't have as much problem on.

It's a project at least!
  Reply With Quote
08/23/14, 12:04 PM   #3
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,579
I know you want to learn about textures, but I imagine you could also use LineControl elements to achieve this.
  Reply With Quote
08/23/14, 12:09 PM   #4
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Texture is actually the easy part, since you don't need any. Just make a texture control template:
xml Code:
  1. <Texture name="GridLine" color="aa000000" layer="BACKGROUND" virtual="true">
  2.    <Dimensions x="1" y="1" />
  3. </Texture>
... and create as many as needed using ZO_ControlPool, and change width or height.
  Reply With Quote
08/23/14, 01:20 PM   #5
skyraker
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 154
Originally Posted by sirinsidiator View Post
I know you want to learn about textures, but I imagine you could also use LineControl elements to achieve this.
I thought about that too, but it still wants a texture for the line.

Originally Posted by merlight View Post
Texture is actually the easy part, since you don't need any. Just make a texture control template:
xml Code:
  1. <Texture name="GridLine" color="aa000000" layer="BACKGROUND" virtual="true">
  2.    <Dimensions x="1" y="1" />
  3. </Texture>
... and create as many as needed using ZO_ControlPool, and change width or height.
I'll take a look at that too. As I said, I'm using this as sort of a learning exercise in texture creations and implementation, so creating a simple box wasn't something too time consuming to learn.
  Reply With Quote
08/28/14, 09:11 AM   #6
skyraker
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 154
Gah. I understand the concept of ControlPool, but I cannot seem to wrap my head around implementation. I see it called in different addons different ways and that gets confusing. I think what is getting me is what parameters it takes. Two examples from two addons:

Lua Code:
  1. ZO_ControlPool.New(self, "XRGACompassPin", ZO_CompassContainer, XRGA.AddonInfo.Prefix.."Pin")
Lua Code:
  1. self.container = GetControl(scrollContainer, "ScrollChild")
  2.     self.checkboxPool = ZO_ControlPool:New("ZO_Options_Checkbox", self.container, "Checkbox")

So obviously self is the object the pool will be in. The first string object is the control (so in my case "GridLine"). The third parameter seems to be some container reference, though I cannot understand how that would apply to mine. The last parameter is the prefix for the ID of each object.

I guess that means I'm stuck on what container object I should use. Any thoughts?
  Reply With Quote
08/28/14, 09:34 AM   #7
skyraker
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 154
To follow on with seeing if I understand ControlPool:

So once I have to Pool I essentially want to maintain a table of created objects that are in use and a table of objects that have been released.

I use AcquireObject() to get/create a new control, place it in the table I created, modify it to what want and display it.

When the grid is 'disabled', I release all the objects back to the pool for the next use.
  Reply With Quote

ESOUI » AddOns » AddOn Search/Requests » Grid


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