PDA

View Full Version : Any way to get rid of U.I. backround image tiling?



Cyjack
August 30th, 2007, 15:03
I'm getting ready to run a Mutants & Masterminds game, and am making a complete generic "modern" re-skin of the interface, as I find the default skin at odds with this setting, and don't see any official alternatives easily available in any centralized location. My goal is to make it totally generic, suitable for a modern or sci-fi setting (or really, anything other than "fantasy"). I'll make it available here in a few days, somehow or another.

My question is 2 part:

1) I'm good at the "artsy" stuff which I figure out easily enough, but I'm kind of a tard when it comes to teh XML. Is there any way to get rid of the tiling on the desktop and chat buffer backround images specifically...have them scale in a 1:1 ratio with the window frame.

2) Is there a compelling reason why I wouldn't want to do this? I can make much more appealing images if they dont have to tile. The files are local assets, so I wouldnt think there would be any bandwidth performance issues involved. Generally speaking, I don't think FG users are running desktop sizes so extreme that disparate resolutions would be an issue, as long as the source images were large enough to look good up to about 1600 or so.

Am I completely wrong about all this? The quality tradoff you make in exchange for those images being seamlessly scalable is huge...as an artist, of course, I'd like to be able to make more deliberately rendered graphics.

Griogre
August 30th, 2007, 18:48
Changing the image is as simple as replacing the existing image with another with the same name (or changing the file name in the XML). If you already using a different ruleset this should not be difficult. To get a 1:1 you need to make the image the same size as the window the game is in. Unfortunately you can't really know what size someone’s window size is and it will vary depending on their resolution and whether they have FG windowed.

The images are local assets so they don't have to be transferred because of size. As long as you include the art as part of your ruleset that resides on the players computer then you are fine. This does mean you probably will not be able to take advantage of “Common” style rulesets or you will need to mix types. This may or may not matter to you.

You grasp of the issues seems fine. The biggest one is you don't what to force a transfer of the image over the Internet. The other is you have no way of knowing if the guy is in 800x600 or 1600x1200.

Cyjack
August 30th, 2007, 20:07
Changing the image is as simple as replacing the existing image with another with the same name (or changing the file name in the XML). If you already using a different ruleset this should not be difficult. To get a 1:1 you need to make the image the same size as the window the game is in. Unfortunately you can't really know what size someone’s window size is and it will vary depending on their resolution and whether they have FG windowed.


Yeah, I'm just swapping out image files, but I guess what I was asking, is there any (simple) way to disable the bit of code that tells the client to tile the backround image when the boundaries of the client window exceed the dimensions of the image, and instead, anchor the edges of the image to the edge of the program window in terms of scaling.

I realise image quality starts to degrade if is displayed larger than its native resolution, but with the average size ranges we're talking about for the client, this would seldom be a problem as long as the source image is large enough. The program can rescale the token images in relation to other images, so it must have some native resampling ability...

This isn't a really big deal, Ive got a tiled version that looks fine, but fully rendered backround images would look so much better than repeating tiles, not to mention being an easier concept to grasp for those who don't have much experience with web graphics and would like to customize their client look. I mean, you would want to avoid image elements that could look obviously distorted by different desktop aspect ratios, but you could add in much more realistic lighting and weathering effects.

Toadwart
August 30th, 2007, 20:54
In FGII the background can be made up of 6 distinct images:
- a tiled background image
- a non-tiled, non-scaled, overlay image
- a tiled left border
- a tiled right border
- a tiled top border
- a tiled bottom border
The built-in d20 ruleset only uses 3 of them (tiled background, overlay and right-border)

Note that the image file is a single composite image containing all 3 parts: the tiled wood background, the darker wooden right border and the partially transparent dragon overlay. The sizes of these are defined in the ruleset xml so you are limited to what you can achieve by just changing the image (e.g. can't supply a larger overlay)


To change the xml:
Look in the base.xml file for the 'desktop' node. This tells FG what frame definition to use for the desktop image. The default being called "desktop"
<desktopframe>desktop</desktopframe>

Then find the frame definition (the default one is defined in graphics_frames.xml)
<framedef name="desktop">
<bitmap file="frames/desktop.png" />
<middle rect="0,0,512,512" />
<right rect="512,0,97,512" />
<decal rect="612,0,512,512" />
</framedef>

Change the file name and sizes here. Yoiu can also add left, top and bottom nodes (in the same way as "right" is used) and/or remove the ones you don't want.
The "rect" values specify the area of the image file to use for that part of the desktop. The first two values are the top left point (x/y), the remaining two are the width and height of the rectangle.

You might try using a plain tileable image (even just boring old grey or black) for "middle" and a full (800x600) "decal" image for the main picture.
People running with 800x600 would have the "decal" fill their entire desktop.
People running with larger resolutions would get the 800x600 decal centred on their desktop with the tiled "middle" image showing up as a border around it.


Another possibility, if you want to really hack the xml, is adding a desktop panel to hold the image.
Using a single "genericcontrol" to display the image I think would result in a background image that scales with the main FG window.
However, I haven't tried this and I don't think panels are allowed to overlap so it wouldn't be able to fill the entire desktop (the pc portraits, the chat area and the books on the right are panel areas too. So it could probably only fit inside the area bordered by those.
I also think the image would scale up not down (i.e. you'd have to define the 800x600 image and have it auto-resize for larger resolutions, rather than a nice 1600x1400 image that auto-shrinks - think it would just crop the right/bottom :()

Cyjack
August 30th, 2007, 22:03
Thanks Toad! Let me mull all this over. I probably wont do anything fancy for this first skin...my priority is to just get something generic out there that I (and anyone else) can use. My larger problem is trying to going to be trying to kludge together some kind of M&M char sheet ;)

decfeeney
August 30th, 2007, 23:40
My larger problem is trying to going to be trying to kludge together some kind of M&M char sheet ;)

I've PMed you with a link to the part kludged character sheet I've been working on. I suspect we can probably assist each other quite nicely.

Any idea how we add the OGL to it (like the one on the d20 ruleset)?

Foen
August 31st, 2007, 06:28
Any idea how we add the OGL to it (like the one on the d20 ruleset)?

If you are talking about the logo and licence text that appears when you select the default d20 ruleset, I've already posted that here (https://www.fantasygrounds.com/forums/showthread.php?t=6276&highlight=licence).

As it requires you to have the ruleset in PAK form, it is best to leave it until last (PAK versions of rulesets are zipped and hence hard to edit, so while it is still fluid it is easier to work on the folder version).

Stuart
(Foen)

decfeeney
August 31st, 2007, 14:58
Thats perfect. Thank you.

Cyjack
September 4th, 2007, 01:06
I posted a shot of the itnerface in the screenshot thread. I just bit the bullet and tiled the backround. At some point in the future ( like after I get some kind of character sheet and combat tracker option in...and actually get my campaign written), I'll try for something a little more spiffy.

https://www.fantasygrounds.com/forums/showthread.php?t=7147

Moebius
December 5th, 2011, 12:16
I am having trouble changing the Chat frame image (chatbox.png) and some others. Basically the frame appears correctly but the content that should appear above it (the chat lines, rolls and so on do not appear. When switching back to the old image everything appears again. I am just editing the png file in photoshop and pasting a layer over the old background so nothing fundamental is changed. Could anybody tell me what the issue my be? Is there any other requisite these frame pngs must have appart from the size?

Moon Wizard
December 10th, 2011, 00:41
It depends on how the windows are defined in the ruleset.

Here are the order the things are drawn:
* Window frames
* Controls in order that they are defined
** Control frames
** Control features (icons, text)
** Control widgets

In addition to that, the icons and frames can have transparent or semi-transparent sections.

The main reasons I have seen things disappear when I am developing are:
* Undefined font used (i.e. font name used is not defined in the ruleset)
* Assumption of transparency (some controls assume that the controls drawn after are partially transparent, such as interior frames)

Let me know if you have any more questions.

Cheers,
JPG

Moebius
December 10th, 2011, 08:15
It depends on how the windows are defined in the ruleset.

Here are the order the things are drawn:

The main reasons I have seen things disappear when I am developing are:
* Undefined font used (i.e. font name used is not defined in the ruleset)
* Assumption of transparency (some controls assume that the controls drawn after are partially transparent, such as interior frames)

Let me know if you have any more questions.

Cheers,
JPG

I am just changing the content of the png file so order is not the issue. I am editing the PNG in Photoshop and there are no transparent sections in it, I just changed the picture displayed inside, I will try with it semi transparent though, just in case.