Thread: Extension to change GM portrait
-
December 15th, 2015, 22:07 #31
Yes indeed. That is exactly what Fantasy Grounds will do. However, in my experience working with raster graphics (I write software applications), it is always optimal to take a larger image and scale it down rather than up, otherwise you get a pixelated or fuzzy look. The scale factor is not extreme as it is so it probably isn't a big deal. Nevertheless, it piqued my curiosity as to why standard portrait images were smaller than they appear in the software.
-
December 15th, 2015, 23:18 #32
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,564
It's always been a trade-off between memory usage (since FG loads everything into memory) vs. resolution. There are some older design decisions before my time which I am not familiar with reasons (63x63, 70x70, 72x72). We recently upped the number for portrait tokens to 100x100 to be more consistent.
We're looking at upping resolution all around once we move to a new platform where we can have load on demand graphics.
Cheers,
JPG
-
December 15th, 2015, 23:22 #33
-
December 15th, 2015, 23:27 #34
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,564
We are in the process of moving Fantasy Grounds to the Unity platform. It has gone in fits and starts, due to delays caused by good news in the form of the Wizards deal coming through and the increase in users. Recently, we added a new person to the team (Carl) who is working primarily on the Unity platform move.
We have a whole laundry list of features that we can implement once we get onto Unity, since it gets rid of some very old code that bottlenecked our development (and probably adds a few gotchas). Our first goal is to get it up and running, and to maintain backward compatibility. We'll get some improvements right out of the gate, though many of them will be under the hood like the graphics improvements.
Regards,
JPG
-
December 15th, 2015, 23:37 #35
Full details:
The portrait .PNG file uploaded by the player will be stored in the campaign \portraits directory on the GM side as a FG id-XXXXX referenced file without the file extension. You can get back to the original image file by copying the file and adding a .png extension. This file is in the base resolution that the player uploaded.
Then, FG uses a number of portrait masks within the FG ruleset to resize the player portrait for use. In CoreRPG based rulesets these files are found in the \graphics\portraits directory:
- portrait_mask.png (63x63) is used to make the portrait image that is shown in the top left of the desktop. This is combined with portrait.png (72x72) to make the actual graphics image used (with a border, etc).
- portrait_chat_mask.png (36x36) is used to make the portrait that will be shown in the chat window. This is combined with portrait_chat.png (40x40) to make the complete graphic used.
- portrait_token_mask.png (90x90) is used to make a token based off the original portrait file. This is combined with portrait_token.png (100x100) to make the complete token graphic used.
- portrait_mini_mask.png (18x18) is used to make a the mini portrait that is used in object sharing (images and story) to show that the object has been shared (the small portrait appears in the bottom left of the main view of the object). This is combined with portrait_mini.png (22x22) to make the complete mini portrait graphic used.
- portrait_target_mask.png (26x26) is used to make a small portrait that is used in the chat window when a GM drags a dice result number to the player portrait on the desktop. This is combined with portrait_target.png (36x32) to make the complete target portrait graphic used (including an arrow graphic) that will be displayed in the chat window. This is really used for purely CoreRPG games, where the dice rolls don't have a specific action type (attack, damage, save, etc. - which have their own graphic).
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
December 16th, 2015, 00:49 #36
Lesser Deity
- Join Date
- Mar 2006
- Location
- Arkansas
- Posts
- 7,401
LOL what Trenloe said. But basically the 63x63 is actuals graphic size without border. Obviously you get better quality if FG doesn't have to scale the image. Personally I usually use 64x64 but I use 32 pixel token scale so it's convenient for me - and powers of 2 out of sheer habit.
-
December 16th, 2015, 04:51 #37
Another option:
Attachment 12228
-
December 16th, 2015, 11:30 #38
Trenloe; just awesome as always
If there is something that you would like to see in Fantasy Grounds that isn't currently part of the software or if there is something you think would improve a ruleset then add your idea here https://www.fantasygrounds.com/featu...rerequests.php
-
December 16th, 2015, 14:01 #39
probably a question for Trenloe...
can I set the value of a string eg <string name="graphics/portraits/gmicon_gary">gm-gary.png</string> or of an icon eg icon name="portrait_gm_token" file="graphics/portraits/gm-gary.png" /> to a value from the database?
-
December 16th, 2015, 17:09 #40
Nope. You can't dynamically assign an icon resource to a file. You can, depending on the FG control, have a bunch of pre-defined icon resources and change those using setIcon: https://www.fantasygrounds.com/refdo...ol.xcp#setIcon However, the icon in a chat message is not a control defined in the ruleset, it's built in to the message data structure: https://www.fantasygrounds.com/refdoc/Comm.xcp
Only tokens can have images directly assigned to them. More info in this thread: https://www.fantasygrounds.com/forum...ol-from-a-file
So, the only way I know of allowing dynamic changes of the GM chat icon would be to write an extension that changes the places where msg.icon is set to the "portrait_gm_token" icon resource and use a different icon resource.Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks