PDA

View Full Version : How to leave the character sheet scalable?



yako2020
November 23rd, 2016, 21:09
I would like to leave the character sheet of the Call of Cthulhu resizable? It is possible?

damned
November 23rd, 2016, 21:21
Character Sheets dont generally scale nicely in the horizontal direction - hey do vertically.

Use something like this in campaign/record_char.xml

<sizelimits>
<minimum width="515" height="610" />
<maximum width="515" />
<dynamic />
</sizelimits>

Zeus
November 23rd, 2016, 22:11
Also, when anchoring your controls use a relative over absolute layout - this will allow the controls to flow in layout when you resize the character sheet.

yako2020
November 23rd, 2016, 22:30
Thanks Damned

yako2020
November 23rd, 2016, 22:57
Is it possible to resize the inventory as well?

yako2020
November 23rd, 2016, 23:01
Original Size:
16568

Resized version:
16569

damned
November 23rd, 2016, 23:28
Also, when anchoring your controls use a relative over absolute layout - this will allow the controls to flow in layout when you resize the character sheet.

Hello stranger!

damned
November 23rd, 2016, 23:29
Is it possible to resize the inventory as well?

Yes it is but you will have to think about hose anchor points and which ones to change :)

yako2020
November 24th, 2016, 12:19
If I understood correctly the anchorage serves to attach an object to a specific point and that I need to change it so that the field I want to become "dynamic".
But whats the problem, I remove the anchored?
I change the anchored to bounds and apply size limit?
Do I make what is static ... dynamic?

damned
November 24th, 2016, 13:40
Without looking at the code.... Im guessing if you stretch that page currently either the bottom panels scale or no panels scale?
You want to anchor the bottom of the Inventory to the bottom of the page. It doesnt have to be closer to the bottom but it has to be anchored to the bottom and the others need to be anchored to Inventory...
To anchor to the bottom go back and look at the code for the Skills frame - but you will need a bigger number...

Zeus
November 24th, 2016, 14:15
Hello stranger!

ello, I know haven't been very active on the forums but I am around and working in the background ;)

yako2020
November 24th, 2016, 15:40
I made my layout do this.
As you can see by default when I add a melee weapon or a weapon away the next field moves.
I would like to do the same with the inventory and the items that follow it


https://youtu.be/xw5CHlaGD2M


https://youtu.be/CBAk8zPH4eA

Trenloe
November 24th, 2016, 16:24
Anchoring with negative (-) values - as these anchor to the bottom/right of the window/control. This can be used to anchor the the bottom/right of a frame/subwindow to the bottom/right of a main window, so when the main window is resized so does the frame/subwindow.

Also look at "relative" anchoring here: http://www.fantasygrounds.com/modguide/windowing.xcp This is what the majority of controls get their dynamic placement from.

There are plenty of examples for relative anchoring throughout the FG rulesets. Search in files for "relative" and take time to understand how the XML is being used - as mentioned in the link above, there will be one anchor that all relative controls use, but the relative anchoring means they anchor to the previous control that has relative anchoring. Essentially, the anchoring of a bunch of controls is stringed together, so if the position of the anchor changes then so do the controls. If you want to make controls within windows adjust their placement dynamically you'll need to take the time to understand this.

yako2020
November 24th, 2016, 21:45
I understand that the back field should have a relation with the previous one, but I do not know where it says .. at least I can not read where it says that if the previous field "increase" the posterior one should move ....

damned
November 24th, 2016, 22:26
Ok I couldnt get the frames to anchor to each other so I anchored them all from the bottom...

Use these values and then try and work out why it works.. :)

<frame_char name="inventoryframe">
<bounds>15,0,480,-305</bounds>
</frame_char>

<frame_char name="artifactframe">
<bounds>15,-310,480,110</bounds>
</frame_char>

<frame_char name="coinframe">
<bounds>15,-205,150,205</bounds>
</frame_char>

<frame_char name="incomeframe">
<bounds>165,-205,330,205</bounds>
</frame_char>

You might play with some of those values.

yako2020
November 25th, 2016, 01:51
The minus symbol does miracles, but I still have problems, because the inventory became adjustable and I had managed to make the artifacts and books adjustable, but the inventory was no longer adjustable and I was standing still and my desire is that Both adjust.

damned
November 25th, 2016, 02:09
ello, I know haven't been very active on the forums but I am around and working in the background ;)

And we love your work!

damned
November 25th, 2016, 02:13
The minus symbol does miracles, but I still have problems, because the inventory became adjustable and I had managed to make the artifacts and books adjustable, but the inventory was no longer adjustable and I was standing still and my desire is that Both adjust.

I also want to be a millionaire.
There is no ratio style measurement.
You cannot say frame = 1/3 or similar so that they all expand.
The code above will allow the Inventory to Scale and the rest to move appropriately.
Or you can leave the inventoryframe as static and and make a few modifications to the artifactframe code above and it will scale.
You cant have both as far as I can tell.

yako2020
November 25th, 2016, 09:51
I would like to use the record_char_main.xml information in the record_char_inventory course that adjustments would need to be made, since the offset part that it is just what I want to do ... ie the previous item moves the posterior one up to a certain limit and only After that it generates a scrollbar.