PDA

View Full Version : Layering graphics on the desktop



Heilemann
February 2nd, 2014, 17:10
I'd like to create an inner shadow that fills out the entire desktop. It'd be a lot easier to do if I could simply have the desktop wood in one layer, and another layer in which the shadow is defined, rather than have a desktop image with the shadow on it. Is that possible?

Moon Wizard
February 3rd, 2014, 07:30
The frame definition for the desktop is a single framedef object. Each framedef object consist of a graphic divided in up to 9 subgraphics (top, left, right, bottom, topleft, topright, bottomleft, bottomright, center). The non-corner graphics are tiled to fill the space.

You could potentially create a panel object that used another graphic to do other things. Just have to make sure that the panel is not capturing any events for the desktop, such as right-click.

Regards,
JPG

Heilemann
February 3rd, 2014, 22:07
Can you point me in the right direction? So far I've reached the stage of copying things from one file into a new one in my extension, and modifying it there. But I'm not sure what construct I would turn to to do something like that, or how to deal with events (like canceling it).

Moon Wizard
February 3rd, 2014, 22:57
The desktop/desktop_panels.xml file in the CoreRPG ruleset contains all the standard desktop panels (character list, chat box, sidebar, GM speaking identity, modifier box). These can be used as a starting point, as well as reviewing the reference for panels and windowclasses.

https://www.fantasygrounds.com/refdoc/panel.xcp
https://www.fantasygrounds.com/refdoc/windowclass.xcp

Cheers,
JPG

Heilemann
February 4th, 2014, 00:24
I'm a little fuzzy on what differentiates a panel from a window?

Heilemann
February 4th, 2014, 02:45
Alright, I managed to get it to render, but on top of everything else. Is there a z-index equivalent in FG? It works perfectly, except the modifier tray doesn't work because it's being covered. So either I need to have the shadow layer ignore events, or render the modifier tray above it.

https://cl.ly/image/0Q3u0z251T3W/Screen-Shot-2014-02-03-at-10.40.25-PM.png

gmkieran
February 4th, 2014, 13:45
Can't help with your problem, but I gotta say, that's a beautiful desktop! nice work!

Heilemann
February 5th, 2014, 00:24
Thank you; much appreciated. I plan on releasing it once I get it spick and spanner. For those following along at home, reordering the <include>s doesn't help the layering issue.

Heilemann
February 5th, 2014, 00:44
For those interested: https://github.com/Heilemann/fg_theonering

Moon Wizard
February 5th, 2014, 00:45
That was the issue I was concerned with.

Can you try using the <disabled /> tag in all the controls within your panel windowclass (if there are any)?

If that doesn't work, it might not be possible with the current FG interface. But I can take a closer look if you want to ping me at [email protected].

JPG

Nickademus
February 5th, 2014, 00:56
What if you made a second modifier tray inside your shadow panel on top of the shadow? Just copy the modifier tray code over and disable it in the original files.

Moon Wizard
February 5th, 2014, 00:59
Also, another idea, try defining your shadow panel before the importruleset tag in the base.xml file.

JPG

Heilemann
February 5th, 2014, 01:28
Alright, I got it. I found the panel for it in Foundation's desktop_classes.xml, added it to my own, and put it below the inner shadow definition, and that fixed it.

The next question is, can the sidebar items be manipulated beyond changing the graphics? :)

Moon Wizard
February 5th, 2014, 01:34
Not really. If you wanted to override the way sidebar lays out or the size of the buttons, then you're probably going to have to override descriptive notes the sidebar.

You might be able to override some of the sidebar parameters by setting them in another script file. But, I haven't tried that before.

I believe that the script that builds the sidebar is called DesktopManager.

Regards,
JPG

Heilemann
February 5th, 2014, 01:42
For now I actually just want to have the inner shadow appear below them; same thing as the modifier tray. I just didn't see anything relating to the sidebar positions etc. last I looked; but I probably just missed it.

Moon Wizard
February 5th, 2014, 02:59
The sidebar is just another panel, with the buttons as controls that are created and laid out on top of it.

Regards,
JPG

Valarian
February 5th, 2014, 07:27
There are up and down states for the buttons, IIRC. Two images, one with the shadow (up) and one without (down) would suffice. The drop shadow would appear normally, but disappear momentarily when the button in the sidebar is pressed.


For now I actually just want to have the inner shadow appear below them; same thing as the modifier tray. I just didn't see anything relating to the sidebar positions etc. last I looked; but I probably just missed it.

Valarian
February 5th, 2014, 07:31
Reordering the includes affects the load order, not the display. If a window class is needed (e.g. for list items) in a later file, the first file containing the list item would need to be loaded first.


Thank you; much appreciated. I plan on releasing it once I get it spick and spanner. For those following along at home, reordering the <include>s doesn't help the layering issue.

Valarian
February 5th, 2014, 07:36
Fantasy Grounds can use direct (coordinate) or relative positioning. See what the modifier box is related to. It may be worth trying displaying the shadow layer over the desktop and then displaying the modifier box relative to the bottom left of the shadow.


Alright, I managed to get it to render, but on top of everything else. Is there a z-index equivalent in FG? It works perfectly, except the modifier tray doesn't work because it's being covered. So either I need to have the shadow layer ignore events, or render the modifier tray above it.

Heilemann
February 5th, 2014, 14:00
Valarian; I fixed the modifier box by changing the order in the XML file. That solves it for that. But for the items that are rendered using LUA (the dock, the characters etc), I'm at a bit of a loss still.

Moon Wizard
February 5th, 2014, 18:59
What are you trying to do with those? Just make them clickable?
Have you already tried defining the shadow panel before the importruleset tag?

Send me a note at [email protected], and I'll see if I can figure out a way to make it work with you.

JPG

Heilemann
February 11th, 2014, 02:50
Wrote in a couple of times; haven't heard anything back yet.

Moon Wizard
February 11th, 2014, 18:58
Yes, I got sidetracked by my primary job, plus I lost Internet for a week at home. Not a good combination for getting FG stuff done.

I took a closer look. There's no way right now to allow events to pass through a windowinstance completely. Thinking that the solution is to add a disabled subtag to the panel tag, which will allow this sort of approach. Also, you won't need to redefine any other panels or windows. It will be scheduled for v3.0.3.

Regards,
JPG