|
12-12-2010, 08:35 PM
|
|
A Griffon
|
|
Join Date: Oct 2009
Server: Unrest
Posts: 155
|
|
Align to another window
Greetings,
Is there a way to have window B auto align to window A if window A is moved?
If window A is player window and window B is effects:
If i move the player window, to have the effects window always aligned to the player window right side?
Thanks,
Draven
|
12-12-2010, 09:12 PM
|
gm10-1
|
|
Join Date: Feb 2006
Posts: 6,479
|
|
Yes, via OnMove code in Window A that moves Window B. Basically OnMove="WindowB.Left = WindowA.Left+WindowA.Width+1 WindowB.Top=WindowA.Top ".
Last edited by gm9 : 12-12-2010 at 09:21 PM.
|
12-12-2010, 10:06 PM
|
|
A Griffon
|
|
Join Date: Oct 2009
Server: Unrest
Posts: 155
|
|
Greetings,
Thanks GM9, its a bit more complex than VG's UI but very understandable. I'll be able to work-in some of my ideas now ... at a later date
Thanks,
Draven
Last edited by Draven_Caine : 12-12-2010 at 10:14 PM.
|
12-19-2010, 09:27 PM
|
|
A Griffon
|
|
Join Date: Oct 2009
Server: Unrest
Posts: 155
|
|
Greetings,
Ok i got the code working, not as dynamic as yours but my player window is a set size so it works.
Is there a way to set a window size to the number of icons in it. This is for the detrimental effects.
Like if there is one row of icons set the window width to 25 width, if there are 2 rows set the width to 50 width?
Thanks,
Draven
|
12-20-2010, 03:32 AM
|
|
A Griffon
|
|
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
|
|
Don't think there is a way. Better off just setting the sorting order with the available options.
|
01-01-2011, 02:49 PM
|
|
A Griffon
|
|
Join Date: Oct 2009
Server: Unrest
Posts: 155
|
|
Quote:
Originally Posted by gm9
Yes, via OnMove code in Window A that moves Window B. Basically OnMove="WindowB.Left = WindowA.Left+WindowA.Width+1 WindowB.Top=WindowA.Top ".
|
A few issues I ran into. - How do it get it to subtract?
- It seems that if you add a variable of plus or minus to the code it doesn't behave in the UI builder, this might be just a UI builder issue though.
Thanks,
Draven
Last edited by Draven_Caine : 01-01-2011 at 02:52 PM.
|
01-01-2011, 06:34 PM
|
|
A Griffon
|
|
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
|
|
UIBuilder doesn't like math calculations that result in numbers higher than... 10? I think....
Something like that. it returns the numbers with large 1e10 type values that break the code.
In-game will work fine though.
|
01-01-2011, 07:00 PM
|
|
A Griffon
|
|
Join Date: Oct 2009
Server: Unrest
Posts: 155
|
|
Ahh, that makes sense, thanks Drumstix.
Do you happen to know how to subtract with GM9's code from this thread, it doesn't seem to work for me, in or out of game.
Thanks,
Draven
|
01-02-2011, 01:15 AM
|
|
A Griffon
|
|
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
|
|
What do you mean? Post your code.
Subtraction is as easy as addition.. just replace + with -
|
01-03-2011, 05:06 PM
|
|
A Griffon
|
|
Join Date: Oct 2009
Server: Unrest
Posts: 155
|
|
Quote:
Originally Posted by Drumstix42
What do you mean? Post your code.
Subtraction is as easy as addition.. just replace + with -
|
The - doesn't seem to take affect but i just didn't auto-align the window since one of the users of the UI wanted to move them separately.
Thanks though,
Draven
|
01-04-2011, 10:02 AM
|
|
A Griffon
|
|
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
|
|
It's usually best to do one math thing at a time, the engine seems to read from right to left in calculations and such, might just be a parsing/spacing error. I've used both addition/subtraction a bit in the interface, so it definitely works.
|
04-17-2011, 12:00 PM
|
|
A Griffon
|
|
Join Date: Oct 2009
Server: Unrest
Posts: 155
|
|
Greetings,
I am reviving this old thread because: - Its my thread
- It is also the same issue, just a diffrent window.
I have the window that "You have gained a skill" window auto-aligned to my effects window (bottom, center).
Now the issue is my effects window has a frame on it, this alignment works until the frame is turned on, or vise-versa. How do I tell it if the frame is used use the effects top alignment + 100, if the frame isnt used, align to the effects window +50 for example?
Thanks,
Draven
|
04-17-2011, 08:47 PM
|
A Griffon
|
|
Join Date: Nov 2005
Server: Nagafen
Posts: 1,096
|
|
Quote:
Originally Posted by Draven_Caine
Greetings,
I am reviving this old thread because: - Its my thread
- It is also the same issue, just a diffrent window.
I have the window that "You have gained a skill" window auto-aligned to my effects window (bottom, center).
Now the issue is my effects window has a frame on it, this alignment works until the frame is turned on, or vise-versa. How do I tell it if the frame is used use the effects top alignment + 100, if the frame isnt used, align to the effects window +50 for example?
Thanks,
Draven
|
Something like
COND = Window.Frame.Visible
TOPA = Window.Top + 100
TOPB = Window.Top + 50
NEWTOP = COND ? TOPA : TOPB
Windowb.Top = NEWTOP
and of course this would be in a button or directly in the onshow of windowb, so it would trigger onshow of windowb.
Silat
Last edited by TalTal : 04-17-2011 at 08:51 PM.
|
04-21-2011, 09:11 AM
|
|
A Griffon
|
|
Join Date: Oct 2009
Server: Unrest
Posts: 155
|
|
OK I got it working last night since I had a break from work.
The only issue I ran into was I am using this code for 2 windows to align them to Window A (effects window)
To align the OnscreenMessage to the effects window: - OnTextChanged="Parent.Parent.OnscreenMessage.Top=Parent.Parent.Effects.Top+89 Parent.Parent.OnscreenMessage.Left=Parent.Parent.Effects.Left+90"
Now to align the AchievementCompleted to the effects window: - OnTextChanged="Parent.Parent.AchievementCompleted.Top=/MainHUD.Effects.Top+89
Parent.Parent.AchievementCompleted.Left=/MainHUD.Effects.Left+90"
should have the same code but it doesnt work. Now I think this has something to do with having to do up to the "Root" when coming back to the /MainHUD.
Any help would be appreciated.
Draven
|
04-21-2011, 10:05 AM
|
Slayer of clock cycles
|
|
Join Date: Nov 2004
Server: Oasis
Posts: 3,464
|
|
Quote:
OnTextChanged="Parent.Parent.AchievementCompleted.Top=/MainHUD.Effects.Top+89
Parent.Parent.AchievementCompleted.Left=/MainHUD.Effects.Left+90"
|
Unless something has change you can't address object the way you are trying to in the bolded code.
Once a window is created in display memory it becomes a child of _HUD. You do not need to worry about nodes like MainHud unless you are working with windows that are not in the display memory.
Basically the way the tree looks for windows that are in display memory is:
_HUD
|- Experience
|- Map
Hope this helps.
Last edited by Landiin : 04-21-2011 at 10:13 AM.
|
04-21-2011, 11:19 AM
|
|
A Griffon
|
|
Join Date: Oct 2009
Server: Unrest
Posts: 155
|
|
Quote:
Originally Posted by Landiin
Unless something has change you can't address object the way you are trying to in the bolded code.
Once a window is created in display memory it becomes a child of _HUD. You do not need to worry about nodes like MainHud unless you are working with windows that are not in the display memory.
Basically the way the tree looks for windows that are in display memory is:
_HUD
|- Experience
|- Map
Hope this helps.
|
Ok but how do i go from the Journal tree to the MainHUD tree?
This doesnt work either.
OnTextChanged="Parent.Parent.AchievementCompleted.Top=Parent.Parent.Parent.MainH UD.Effects.Top+89
Parent.Parent.AchievementCompleted.Left=Parent.Parent.Parent.MainHUD.Effects.Lef t+90"
I need to go from the text field in the Journals/AchievementCompleted/TextField --> MainHUD.Effects. Now the problem I see is I cant use "Root" as a parent the same way i have been in other windows.
Basiclly I am telling the AchievementCompleted window when the text field changes set the top to what the effects window top is plus 89.
Thanks,
Draven
|
04-21-2011, 12:48 PM
|
gm10-1
|
|
Join Date: Feb 2006
Posts: 6,479
|
|
Quote:
Originally Posted by Draven_Caine
Ok but how do i go from the Journal tree to the MainHUD tree?
|
Read what Landiin wrote, for your purposes there is no MainHUD tree, it's all in the same tree.
|
04-21-2011, 01:35 PM
|
|
A Griffon
|
|
Join Date: Oct 2009
Server: Unrest
Posts: 155
|
|
Still doesnt make sense for what I am trying to do.
After the UI is loaded, all windows are:
_hud
--Map
--AcheievementCompleted
--Effects
--Maintained
Is this correct, or no?
If this is the case I see how to do it if this is incorrect, I am still at square one.
Thanks,
Draven
|
04-21-2011, 06:04 PM
|
|
A Griffon
|
|
Join Date: Oct 2004
Server: Antonia Bayle
Posts: 3,287
|
|
Example:
Inventory
|- Broker
MainHUD
|- Persona
When loaded into game Broker and Persona are both located under the same Parent page, instead of different ones. So you don't have to navigate up the tree as far. Only one parent level past a window's main page.
|
04-21-2011, 08:45 PM
|
|
A Griffon
|
|
Join Date: Oct 2009
Server: Unrest
Posts: 155
|
|
Oh awsome,
Thanks Druxskix that is much clearer.
I got it working so its like effects, OnscreenMessege and Acheievement are all under MainHUD (behaviour like).
Thanks again everyone,
Draven
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:35 AM.
|
|