PDA

View Full Version : Why its my number window so teeny/flattened?



Varsuuk
April 2nd, 2018, 00:29
I cannot seem to figure out why the attribute bonus section is so "flattened" - I'm sure I am using some weird thing unaware but cannot see it when I trace these darn things... I wanted (first try) to look just like the Scores one (just not editable, droppable, etc) but not getting there below is the charsheet_main.xml related section.



<!-- Attribute Scores -->
<frame_char name="attributeframe">
<anchored to="classlevelframe" position="belowleft" offset="0,0"
width="155" height="220" />
</frame_char>


<!-- Strength -->
<number_charattributescore name="strength" source="abilities.strength.score">
<anchored to="attributeframe" position="insidetopright" offset="20,25" />
<description textres="char_tooltip_str" />
</number_charattributescore>

<string_charattributelabel name="strength_label">
<anchored to="strength" />
<static textres="char_strength" />
</string_charattributelabel>
... other stats...

<!-- Attribute Bonuses -->
<frame_char name="attributebonusframe">
<anchored to="attributeframe" position="right"
width="200" />
</frame_char>


<label>
<anchored to="attributebonusframe" position="insidetop"
offset="15,7" height="20" />
<center />
<static textres="char_label_attribute_bonuses" />
<disabled />
</label>


<number_bonusfield name="strength_bonustohit" source="abilities.strength.bonustohit">
<anchored to="attributebonusframe" position="insidetopright" offset="20,45" />
<description textres="char_tooltip_dex" />
</number_bonusfield>




What's odd to me, is that the width/height seem to be identical in underlying controls (albeit different base window classes)



<template name="number_charattributescore">
<basicnumber>
<anchored position="belowleft" offset="0,12" width="32" height="20" />
<rollable />
<min>3</min>
<max>18</max>
<default>9</default>
<!-- @TODO Scripting -->
<!-- <script file="campaign/scripts/number_charattributescores.lua" /> -->
</basicnumber>
</template>
...snip...

<template name="number_bonusfield">
<number>
<frame name="charsheet_attribute_bonus_frame" />
<anchored position="belowleft" offset="0,12" width="32" height="20" />
<displaysign />
<nokeyedit />
<hideonvalue>0</hideonvalue>
</number>
</template>


The bonus field uses the frame "fielddark.png" (from C&C)
The Score field uses the "groupbox.png" (from C&C)

My setup so far has been starting with nothing, then grabbing stuff from AD&D (Celestian), C&C, (maybe some in 5e?) and of course, referencing CoreRPG. On top of that, I have done my own templates and the like.


I bet this is obvious and I'magonnakickmyself.

22827

shadzar
April 2nd, 2018, 00:56
first thing i notice is it is missing <anchored to="">

damned
April 2nd, 2018, 01:27
I think that you might find that basicnumber and number will have slightly different definitions.

Varsuuk
April 2nd, 2018, 01:45
Yup, I did, but air didn’t see how it has this affect yet. But just checking between sets of Jesus Christ Superstar... will need to look after, thanks,
!

damned
April 2nd, 2018, 01:50
Its number and basicnumber.... go look at their definitions.

Varsuuk
April 2nd, 2018, 01:58
first thing i notice is it is missing <anchored to="">

Which one is missing to=“” (another commercial break and reading on tablet)

(wow, Sara Bareilles!)

Varsuuk
April 2nd, 2018, 04:20
HOOO-AH - thank you, no matter how many times I saw it, I missed the missing offset :) (now will read with offset means here - I know it does stuff with the bitmap, I recall being scared trying to figure out how 5e gets it desktop from the offsets lol even after reading Runequest tutorial)

Putting the copy/pasted derivation chain into a text editor made it clear.



For those that might be starting, to see what sort of thing "gets ya":
The size I wanted:


<template name="simplenumber">
<number>
<droptypes>
<type>number</type>
</droptypes>
<font>sheetnumber</font>
</number>
</template>


<template name="basicnumber">
<simplenumber>
<frame mergerule="replace" name="fielddark" ***offset="7,5,7,5"*** />
<stateframe>
<keyedit name="fieldfocus" offset="7,5,7,5" />
<hover name="fieldfocus" offset="7,5,7,5" hidereadonly="true" />
<drophilight name="fieldfocus" offset="7,5,7,5" hidereadonly="true" />
</stateframe>
</simplenumber>
</template>


<template name="number_charattributescore">
<basicnumber>
<anchored position="belowleft" offset="0,12" width="32" height="20" />
<rollable />
<min>3</min>
<max>18</max>
<default>9</default>
<!-- @TODO Scripting -->
<!-- <script file="campaign/scripts/number_charattributescores.lua" /> -->
</basicnumber>
</template>


<number_charattributescore name="strength" source="abilities.strength.score">
<anchored to="attributeframe" position="insidetopright" offset="20,25" />
<description textres="char_tooltip_str" />
</number_charattributescore>



The Shrunken one:


<template name="number">
<numberfield>
<noreset />
<script file="common/scripts/number.lua" />
</numberfield>
</template>




<template name="number_bonusfield">
<number>
<frame name="charsheet_attribute_bonus_frame" ***NOTHING***/>
<anchored position="belowleft" offset="0,12" width="32" height="20" />
<displaysign />
<nokeyedit />
<hideonvalue>0</hideonvalue>
</number>
</template>


<number_bonusfield name="strength_bonustohit" source="abilities.strength.bonustohit">
<anchored to="attributebonusframe" position="insidetopright" offset="20,45" />
<description textres="char_tooltip_dex" />
</number_bonusfield>

Varsuuk
April 2nd, 2018, 05:20
Cookin' with gas-o-line... entered the 10 attribute bonus categories in one swell foop. Now I just have to break them up into two columns while maintaining my "move one anchor, the page follows" thing.

Thanks again.

Trenloe
April 2nd, 2018, 13:46
HOOO-AH - thank you, no matter how many times I saw it, I missed the missing offset :) (now will read with offset means here - I know it does stuff with the bitmap, I recall being scared trying to figure out how 5e gets it desktop from the offsets lol even after reading Runequest tutorial)
Offsets are very, very important - to all FG control positioning, not just bitmaps.

Don't be scared. Learn them. You need to.

Varsuuk
April 2nd, 2018, 18:17
Yeah, I seem to be being bitten perhaps by same thing again. I actually "put off" the whole "taking one bitmap and using offsets to determine what section of it will be used" only because I dreaded having to load the bitmap up and figuring out how to determine the pixel settings to use then the harder part - somehow CREATING a hodgepodge like that and doing same myself. I was putting it off because not yet working on "panels/layout" and hoped when did, I could use separate bitmaps vs that combo thing. But that was to learn another day.

The following shows the leaking left ;) issue. Don't mind the rest of the layout - I am stretching things and testing position as I learn

22829

I think the minimal info to see the issue is:

This is the simplified during my testing controls/things, in this one it SHOULD be I think in upper right on the INSIDE of the frame but the first letter leaks out to left outside of frame.




<!-- Attribute Bonuses -->
<frame_char name="attributebonusframe">
<anchored to="attributeframe" position="righthigh"
width="450" height="365"/>
</frame_char>

<!-- Width should be half of the frame. -->
<genericcontrol name="column_anchor">
<anchored to="attributebonusframe" position="insidetopleft"
width="225" height="0" />
<invsible />
<disabled />
</genericcontrol>

<label>
<anchored to="attributebonusframe" position="insidetop"
offset="15,7" height="20" />
<center />
<static textres="char_label_attribute_bonuses" />
<disabled />
</label>

I originally did some of this with templates then kept modifying until finally just put all in line to troubleshoot:

<label name="strength_bonustohit_label">
<anchored height="20">
<top parent="attributebonusframe" anchor="top" />
<left parent="attributebonusframe" anchor="left" offset="0"/>
<static />
<disabled />
<tooltip />
</anchored>
<static textres="char_label_attribute_bonuses_bonus_to_hit" />
</label>



My wondering that I cannot get is why does the text resource drift to left of anchoring frame without an offset to force it?

Now, I am actually binding to right to right align text, but was trying things and saw this problem which I didn't understand.

Varsuuk
April 2nd, 2018, 18:45
EDITING PRIOR POST TO SIMPLIFY - TMI :( lol