PDA

View Full Version : Making frame dinamicaly resizable ?



PolluxTroy
June 15th, 2017, 13:39
Hi, I'ts me, again :/

After days of fails trying to create a custom PC charsheet, i'm stuck on this :
On the Abilities page on the charsheet, i have 4 frame containing : Traits, Abilities, Proficiency, Feats.
I'm able to make the sheet resizable, but i can't find how to make each frame dynamically resizable.

The only thing i was abble to do at this time is :

- Top Left Frame : Resizable Vertically
- Top Right Frame : Resizable Horizontally/Vertically
- Bottom Left : Nothing
- Bottom Right : Resizable Horizontally

Can someone help me to understand how to do that ? Thanks a lot.
I'd like to have 4 frame with same size, but that they resize dynamically with the charsheet, all the same way.

Sorry for my english if you d'ont understand ;)

I'm working on this part of the xml code for positionning :



<sheetdata>
<frame_char name="featframe">
<bounds>255,-225,-25,225</bounds>
</frame_char>
<label_frametop>
<anchored to="featframe" />
<static textres="char_label_feats" />
</label_frametop>
<list_charabilities name="feats">
<anchored to="featframe" />
<datasource>.featlist</datasource>
<class>char_ability_feat</class>
</list_charabilities>
<scrollbar>
<anchored to="feats" />
<target>feats</target>
</scrollbar>
<button_iedit name="feats_iedit">
<anchored to="feats" position="aboveright" offset="5,5" />
<target>feats</target>
</button_iedit>
<button_iadd name="feats_iadd">
<anchored to="feats" position="aboveleft" offset="5,5" />
<target>feats</target>
</button_iadd>

<frame_char name="specialabilityframe">
<bounds>255,0,-25,-225</bounds>
</frame_char>
<label_frametop>
<anchored to="specialabilityframe" />
<static textres="char_label_sa" />
</label_frametop>
<list_charabilities name="specialabilities">
<anchored to="specialabilityframe" />
<datasource>.specialabilitylist</datasource>
<class>char_ability_class</class>
</list_charabilities>
<scrollbar>
<anchored to="specialabilities" />
<target>specialabilities</target>
</scrollbar>
<button_iedit name="specialabilities_iedit">
<anchored to="specialabilities" position="aboveright" offset="5,5" />
<target>specialabilities</target>
</button_iedit>
<button_iadd name="specialabilities_iadd">
<anchored to="specialabilities" position="aboveleft" offset="5,5" />
<target>specialabilities</target>
</button_iadd>

<frame_char name="proficiencyframe">
<bounds>15,-225,240,225</bounds>
</frame_char>
<label_frametop>
<anchored to="proficiencyframe" />
<static textres="char_label_proficiencies" />
</label_frametop>
<list_charabilities name="proficiencies">
<anchored to="proficiencyframe" />
<datasource>.proficiencylist</datasource>
<class>char_ability_proficiency</class>
</list_charabilities>
<scrollbar>
<anchored to="proficiencies" />
<target>proficiencies</target>
</scrollbar>
<button_iedit name="proficiencies_iedit">
<anchored to="proficiencies" position="aboveright" offset="5,5" />
<target>proficiencies</target>
</button_iedit>
<button_iadd name="proficiencies_iadd">
<anchored to="proficiencies" position="aboveleft" offset="5,5" />
<target>proficiencies</target>
</button_iadd>

<frame_char name="traitframe">
<bounds>15,0,240,-225</bounds>
</frame_char>
<label_frametop>
<anchored to="traitframe" />
<static textres="char_label_traits" />
</label_frametop>
<list_charabilities name="traits">
<anchored to="traitframe" />
<datasource>.traitlist</datasource>
<class>char_ability_race</class>
</list_charabilities>
<scrollbar>
<anchored to="traits" />
<target>traits</target>
</scrollbar>
<button_iedit name="traits_iedit">
<anchored to="traits" position="aboveright" offset="5,5" />
<target>traits</target>
</button_iedit>
<button_iadd name="traits_iadd">
<anchored to="traits" position="aboveleft" offset="5,5" />
<target>traits</target>
</button_iadd>
</sheetdata>

Trenloe
June 15th, 2017, 16:11
I'd like to have 4 frame with same size, but that they resize dynamically with the charsheet, all the same way.
You're going to have to use a mixture of normal and negative static bounds to anchor portions of the frames to the edges of the window.

Then, as you want everything to be the same size, the dynamic corners need to be anchored to the center of the window.

That is:
- Feats frame (top left) - static bounds for the top left, dynamic bounds for the bottom right.
- Special Abilities frame (top right) - static bounds for the top and right, dynamic bounds for the bottom and left right.
- Proficiency frame (bottom left) - static bounds for the bottom and left dynamic bounds for the top and right.
- Racial Traits frame (bottom right) - static bounds for the bottom and right, dynamic bounds for the top and left.

See post #6 for info on anchoring to the center of the window.

PolluxTroy
June 15th, 2017, 16:19
Ok, so i need to create a lua script in order to do that ?

Trenloe
June 15th, 2017, 16:33
Ok, so i need to create a lua script in order to do that ?
Yes.

Trenloe
June 15th, 2017, 16:40
Or, hang on a second... I'm seeing a anchor="center" statement in the Savage Worlds charsheet, that might do what you want. Give me a moment to check it out...

Trenloe
June 15th, 2017, 16:50
I haven't tested this. But you could try something like this, using the anchor="center" which, in this example, is the center of the window.


<frame_char name="featframe">
<anchored>
<top anchor="top" offset="225" />
<left anchor="left" offset="255" />
<bottom anchor="center" offset="-20" />
<right anchor="center" offset="-20" />
</anchored>
</frame_char>

This will have a static top and left position - the offset is relative to the edge of the window. But the bottom and right of the frame will be offset 20 pixels to the top and left of the center of the window.

Let me know if this works. You'll probably have to experiment with the exact offset values.

PolluxTroy
June 15th, 2017, 18:49
It seems to work, for the feats frame, but the 2nd frame on the right "Particularités" it's not. It's dynamic but the left border don't move.



<frame_char name="featframe">
<anchored>
<top anchor="top" offset="0" />
<left anchor="left" offset="15" />
<bottom anchor="center" offset="-20" />
<right anchor="center" offset="-20" />
</anchored>
</frame_char>

<frame_char name="specialabilityframe">
<anchored>
<top anchor="top" offset="0" />
<left anchor="left" offset="255" />
<bottom anchor="center" offset="-20" />
<right anchor="center" offset="-20" />
</anchored>
</frame_char>

19394
19395

Trenloe
June 15th, 2017, 22:24
It's dynamic but the left border don't move.
That's because you're still using a static anchor to the left side of the window for the left side of that frame. Each frame is different. See what I listed in post #2 for what has to be static and what has to be dynamic (anchored to "center") for each frame.

PolluxTroy
June 16th, 2017, 09:02
Oh, my bad. It works great like this. Thank you Trenole, you're the best ;)

A last little question : If i want to share some extensions i've made, what i must add in them for copyright notice ? I've searched on the forum but didn't see anything clear.
By copyright i'ts not for my wrk but because extensions are using some corerpg and 3.5e part modified by me.

Trenloe
June 16th, 2017, 11:00
Include the Smiteworks copyright statement that comes in the ruleset announcement that appears in the chat window.