PDA

View Full Version : Dynamic Decal Positioning..



Blackfoot
December 24th, 2013, 17:51
I'm frustrated with the appearance of my decal in different screen resolutions for my custom desktops.
Is there a way to get the decal to display dynamically, centered between the toolbar and the right side of the chat window?
Currently the default seems to be centered between the toolbar and the left edge of the screen.

I realize this gets funky if folks start messing with the size of the chat window... so maybe it would be best to center between the right side of the 'standard' chat window and the toolbar.

Griogre
December 24th, 2013, 17:58
With a moveable chat window that could be problematic. You could get the decal under the chat window when it was moved over to the right side of the desktop. You might be able to get the same effect you want if you made the left desktop frame the size of the chat window + the distance between the left side of the default chat window and the left edge.

Blackfoot
December 24th, 2013, 18:12
Agreed. I think it has to be positioned in the center between the default chat window right edge and the left edge of the toolbar... otherwise in some screen resolutions the decal is partially obscured by the chat window. This won't fix the issue when someone has an oversized chat window... but in most standard cases it will appear correctly.... the question is... how to do it.

Trenloe
December 24th, 2013, 18:13
What is the decal anchored to - specifically <parent>? More info on anchoring of controls here: https://www.fantasygrounds.com/modguide/windowing.xcp

For example, to anchor the left side of a control/window to the right side of the chatwindow (plus 5 pixels) use:

<anchored>
<left>
<parent>chatwindow</parent>
<anchor>right</anchor>
<offset>5</offset>
</left>

But, as Griogre mentions - this could get very screwed up with a movable chat window. You may want to consider using a negative offset from the right side of the desktop to have it always a certain distance from the right side. Or, just use a static offset from the left side of the desktop to have it always a certain distance from the left side.

Blackfoot
December 24th, 2013, 18:48
I was hoping I could do it without doing more than a simple graphics_frames.xml mod... but it seems like I'm going to need to do more than that.

I did a search for the decal in the files for CoreRPG but the only place it shows up is in graphics_frames... hrm...

Trenloe
December 24th, 2013, 19:15
Ah, right - I was confused as to what you were trying to do.

The positioning, I believe, is controlled in the base FantasyGrounds.exe so there's not much you can do in terms of changing where the decal centres and is anchored to.

The best you can do is play around with the size/design of the actual decal in desktop.png and the <decal> size in graphics_frames.xml.

Blackfoot
December 24th, 2013, 19:40
Hrm. I suspected as much.
This is of course not just a problem in my ruleset but actually happens all the time, it is a problem for me because I elected to put 'type' into my decal... I guess I need to rethink that.

Trenloe
December 24th, 2013, 20:14
Try adding some blank space on the left of the decal image - start with the same width blank space as the default chat window width. Then experiment from there...

Blackfoot
December 24th, 2013, 20:53
I added 300 pixels at the left side of the decal....
That seems to have resolved it. I can't really check out all possible resolutions.. but it definitely looks better in full screen and windowed on my laptop.
Thanks.

Griogre
December 24th, 2013, 22:01
Like Trenloe mentioned the decal placement is controlled by the exe. You can manipulate this because as I remember the decal is centered in the middle rectangle of the desktop. The framedef can be defined with corners, top, bottom, left, right and middle rectangles. The corners are fixed in size but the left and right rectangles expand vertically and the top and bottom rectangles expanded horizontally. The middle rectangle is effectively anchored to the inside of the corners and left, right, top and bottom rectangles. Typically all of the rectangle textures are tileable at least in the direction they stretch.

What I was suggesting was by making the left side and left top and left bottom corner rectangles the width of the default chat window plus a few pixels would force the middle rectangle to start to the right of the default location of the chat window and since the decal is centered in the middle rectangle this would force the decal out from under the chat window unless the decal is bigger than the center rectangle.

Blackfoot
December 25th, 2013, 00:43
Hmm.. that sounds like a bit more elegant a solution than the one I've worked thus far (adding a bunch of extra blank space to the graphic).. so I'll try that.
So I get this straight...

<framedef name="desktop">
<bitmap file="graphics/frames/desktop.png" />
<middle rect="0,0,512,512" />
<right rect="512,0,100,512" />
<decal rect="612,0,512,512" />
</framedef>This is the default code for the desktop definition for CoreRPG.
You are suggesting making 'middle' something like
rect="300, 0, 512, 512" ?

EDIT: OK.. that didn't work. :)
EDIT: Tried -300 too.. yeah.. that didn't work at all.

Griogre
December 25th, 2013, 02:22
I believe once you start detailing the various rectangles you have to do like a left, middle and right. IE for the Pirates skin I made a while back the framedef is:


<!-- Desktop (overrides graphics_frames.xml definition) -->
<framedef name="desktop">
<bitmap file="desktop_background.png" />
<topleft rect="23,10,95,100" />
<top rect="120,10,180,100"></top>
<topright rect="302,10,90,100" />
<left rect="23,105,95,300" />
<middle rect="120,110,175,290" />
<right rect="302,105,90,298" />
<bottomleft rect="23,410,95,100"/>
<bottom rect="120,410,180,100"></bottom>
<bottomright rect="302,410,90,100"/>
<decal rect="600,0,765,512" />
</framedef>


Edit: found the screen of the desktop. The wood borders are the left, right, top, bottom rectangles and corners. The white is the middle rectangle and the map is the decal. Note I made the chat window a bit transparent instead of doing what you are doing but I wanted the players to have the map as an overall reference of the area and didn't want to shrink it any more.

https://i105.photobucket.com/albums/m222/Griogre/PotSMDesktop.png

Griogre
December 25th, 2013, 03:00
Wierd to reply to my own post but, I was thinking more about your decal. Have you considered placing you Champions logo in the chat window as the highlight? That can be very effective. The highlight only shows up when a die is dragged into chat. IE In my Pirate's skin I added the skull, swords and ships highlight for setting the mood:

https://i105.photobucket.com/albums/m222/Griogre/ChatboxHighlight.png

The highlight can be very effective but you need to make sure you can read any text in the chat window - so the mood doesn't turn to annoyance. :p

Blacky
December 27th, 2013, 21:40
In my opinion, it's more a problem of design than of coding.

The chat window can (probably) move around the desktop. So unless you're willing to write a lot of code to dynamically move the desktop decal around on each client, and code it to work around FG is that's even possible, with this design you're screwed.

I would advise to rethink said design. Don't try to force something unto FG, but design it (meaning: adapt your tastes and wants and feels to the needs of the software).

Several examples from the top of my head:

- Put your logo near an edge, for example the top right or middle right edge. Just left the of the sidebar, or even in the sidebar (but graphically popping out of it).
- Remove the logo from the desktop, put it somewhere else. For example include it's essence into the buttons, dividing it and putting a part of it into each sidebar button. Or make it smaller, and put it in the chat as a welcoming message for example, or displayed smaller as an icon when something important (whatever, I guess it could be done automaticaly when a PC get a critical success on a test or something) happens.
- Remove the logo, and put it somewhere hidden but displayed a lot. Like on the Image loading screen if you don't preload everything, or on the image mask background, or the image toolbar, or more simply on your PC character sheets.
- Modify your logo to something that can be tiled in at least one direction, and put it on the desktop itself (like a silhouetted marching band of super heroes on the bottom just above the hotkey bar or something).
- If you expect your players to not move or strongly resize the chat window, you could offset the logo a little to the right (use a big decal with lots of transparency on its left, like a margin) and make it much more graphically subtle so it's not such a big deal if the chat window hides it.

Also remember that if FG only handle small files, you still have 2048 pixels to work with (important for the edge tiling logo). If none of your player have a bigger screen than Full HD (not 4K or Retina thingie), and have only one screen, you're good you don't even need tiling in this example.

Blackfoot
December 27th, 2013, 22:35
I don't think the 'decal' tiles, only the 'middle' does... no?

Blacky
December 27th, 2013, 23:00
Anything but the decal and the corners tile.

Blackfoot
December 27th, 2013, 23:26
I got it to work using Trenloe's solution a while back. I couldn't quite figure how to make Griogre's solution work... although he gave me some nice ideas for other 'campaign' desktops using the map as the decal.. very nice stuff there.

Thanks guys.