GMBazUK
April 12th, 2008, 09:47
Im trying (being the operative word), to create a template which will provide an alternative to the template which creates the text and line combo for name race etc, albeit with smaller text headings.
<template name="labeledstring">
<stringfield>
<font>sheettext</font>
<frame>
<name>textline</name>
</frame>
<script>
labelwidget = nil;
function onInit()
labelwidget = addTextWidget("sheetlabelinline", string.upper(label[1]));
local w,h = labelwidget.getSize();
labelwidget.setPosition("bottomleft", w/2, h/2-5);
end
</script>
</stringfield>
</template>
This is the xml and script responsible... I think.
What I have tried is:
Copying and renaming the template... Labeledstring small
reassigning the font to a smaller font I made myself and used successfully elsewhere
referencing the template in the corresponding xml for the sheet in question.
It doesnt work. The text size is the same as it was before.
In complete ignorance of Lua (and some might say xml), I have a sneaky feeling the script might be dictating the text size?
Could someone please explain briefly what the script is doing, and how I might accomplish my goal.
Thanks in advance.
Baz
<template name="labeledstring">
<stringfield>
<font>sheettext</font>
<frame>
<name>textline</name>
</frame>
<script>
labelwidget = nil;
function onInit()
labelwidget = addTextWidget("sheetlabelinline", string.upper(label[1]));
local w,h = labelwidget.getSize();
labelwidget.setPosition("bottomleft", w/2, h/2-5);
end
</script>
</stringfield>
</template>
This is the xml and script responsible... I think.
What I have tried is:
Copying and renaming the template... Labeledstring small
reassigning the font to a smaller font I made myself and used successfully elsewhere
referencing the template in the corresponding xml for the sheet in question.
It doesnt work. The text size is the same as it was before.
In complete ignorance of Lua (and some might say xml), I have a sneaky feeling the script might be dictating the text size?
Could someone please explain briefly what the script is doing, and how I might accomplish my goal.
Thanks in advance.
Baz