PDA

View Full Version : Making a theme need CHATBOX help



Wookiee420
May 23rd, 2017, 22:21
So as the title suggests I am making a theme, I am basing it off one I have so that I have a "template" of sorts.
i got the chatbox to look right when normal but when you change the size of the box it "breaks"19098<--this is it normal size, and this is it shifted -->19099
the dimensions are 596hx388w, and this is the code i use below

<framedef name="chatbox">
<bitmap file="graphics/frames/chatbox.png"/>
<offset>596,596,150,388</offset>
</framedef>

Any help would be greatly appreciated.

Trenloe
May 23rd, 2017, 22:24
Looks like the various component definitions (right, topright, etc.) in the framedef don't match with the correct positions of these components in the image file.

See Frames here: https://www.fantasygrounds.com/modguide/resources.xcp
More info on framedef here: https://www.fantasygrounds.com/refdoc/framedef.xcp

Wookiee420
May 23rd, 2017, 22:32
thank you

Wookiee420
May 23rd, 2017, 22:39
so using the code you linked me to would i just "duplicate" all that i wrote in all the lines? i am struggling to understand what goes where, thats why i used the "tiny version" of the code

<framedef name="chatbox">
<bitmap file="graphics/frames/chatbox.jpg"/>
<topleft rect="0,0,0,0" />
<top rect="0,0,0,0" />
<topright rect="0,0,0,0" />
<left rect="0,0,0,0" />
<middle rect="0,0,882,1300" />
<right rect="0,0,0,0" />
<bottomleft rect="0,0,0,0" />
<bottom rect="0,0,0,0" />
<bottomright rect="0,0,0,0" />
</framedef>

Trenloe
May 23rd, 2017, 22:48
If you do that, then it means that there are not corner or side graphics within your image - which, from your screenshot, there are these components, so using zeros for the sides and corners won't work (as you're seeing).

Frames are made up of the 9 areas listed in the pages I linked above. The four corners, 4 sides and the middle. These 9 components will be used to make up the end graphic, no matter what the size - the corners always stay the same, the sides are combined (if needed) to make the side graphics and the middle is tiled horizontally and vertically to fill in the middle.

You need to work out the pixel coordinates for all of these individual components within the base graphics/frames/chatbox.jpg image.

Wookiee420
May 23rd, 2017, 23:01
ok, i figured out how to find the pixel coordinates and then how do i decide where to do it and also the width and height, i see in your link that they change, it confuses me without having an image to look at to see what it is referring to. this thread https://www.fantasygrounds.com/forums/showthread.php?21264-Imagebox&p=177232&viewfull=1#post177232 has an image, but it is for the most part a blank image that only sorta helps me....or is it as long as the dimensions of the image match the total size of the image it works? can i decide on my own where each section ends? is it that, for lack of a better word, arbitrary? meaning can i make the 9 segments any size i want, again, as long as its the total size of the image, and then keep it "in sync" having left/middle/right ending/starting at same points?

i think me writing this out is helping me figure it out, just need to make sure i am on the right track :) thank you!!!

Trenloe
May 23rd, 2017, 23:08
Each image will be different - if it has a border on it. If there is no border, then there is no need to worry about the corners or the edges.

What you need to do is look at the image and decide what is needed to make: each of the four corners, expandable sides, the middle. They don't have to all add up to the total image size - you just need to make sure that each of the 9 components are the correct graphic to draw the relevant component.

Moon Wizard
May 23rd, 2017, 23:11
Here's a visual representation from the Unity web site that might help you understand the way 9-slices work. In FG, the 9-slices are tiled for edges and middle when the defined graphical slice is not large enough by itself.
https://docs.unity3d.com/Manual/9SliceSprites.html

Regards,
JPG

Wookiee420
May 23rd, 2017, 23:56
that makes complete sense, thank you Moon, and Trenloe, with all these explanations and thinks, i think i understand it :)

Wookiee420
May 24th, 2017, 01:18
i got it!!! thanks guys!!!

19101

Trenloe
May 24th, 2017, 01:22
Looking good! :)