Difference between revisions of "SHIP:TextframeModel"

From Serious Documentation
Jump to: navigation, search
(Created page with "Text selection and styling properties are common to a variety of {{Node|displayable}} nodes, including {{Node|box}} and {{Node|text}}. This common properties are called the [...")
 
Line 1: Line 1:
Text selection and styling properties are common to a variety of {{Node|displayable}} nodes, including {{Node|box}} and {{Node|text}}.
+
[[SHIP:Node|Node Home]]
 +
__TOC__
 +
{| class="wikitable" style="margin: 1em auto 1em auto;"
 +
! scope="col" | Node Type
 +
! scope="col" | Description
 +
|-
 +
|<onlyinclude>{{Node|textframe}}{{#if: {{{1|}}}|{{{1}}} }}||A generic text container, available as a reusable resource or layout element.</onlyinclude>
 +
|}
 +
The {{Node|textframe}} node is the generic text container used to position and enclose other text nodes.  They can be nested, stacked, and overlapped. Touch events can be sensed within them.  They can be invisible, partially tranparent, or fully opaque.  And they have all the properties of the [[SHIP:TextframeModel|TextframeModel]], including margin, borders, padding, and more.
  
This common properties are called the [[SHIP:TextframeModel|Text Frame Model]] properties, and include {{Prop|textframemodel|textfont}}, {{Prop|textframemodel|textsize}}, {{Prop|textframemodel|textcolor}} and more.
+
{{Node|textframe}} nodes can exist in the {{Node|layout}} area or the {{Node|resources}} area. In the {{Node|resources}} area, the {{Node|textframe}} forms a template of properties that can be inherited by a {{Node|textframe}} in the {{Node|layout}} area.
  
== [[SHIP:TextframeModel|Text Frame Model]] Property Summary ==
+
== Ancestors ==
 
+
The following nodes are permitted to have {{Node|textframe}}s as descendants:
The following table summarizes the set of [[SHIP:TextframeModel|Text Frame Model]] properties.
+
{| class="wikitable" style="margin: 1em auto 1em auto;"
<onlyinclude>
+
! scope="col" | Node Type
{{PropTableStart|TextModel Property Summary}}
+
! scope="col" | Description
|{{:SHIP:Property:textmodel:textfont}}
 
 
|-
 
|-
|{{:SHIP:Property:textmodel:textsize}}
+
|{{:SHIP:Node:box|{{†}}}}
 
|-
 
|-
|{{:SHIP:Property:textmodel:textstyle}}
+
|{{:SHIP:Node:frame|{{†}}}}
 
|-
 
|-
|{{:SHIP:Property:textframemodel:textdirection}}
+
|{{:SHIP:Node:layout}}
 
|-
 
|-
|{{:SHIP:Property:textmodel:texthalign}}
+
|{{:SHIP:Node:page|{{†}}}}
 
|-
 
|-
|{{:SHIP:Property:textmodel:textvalign}}
+
|{{:SHIP:Node:textframe|{{†}}}}
 +
|}
 +
{{†}}{{Node|textframe}} nodes are permitted ''directly'' underneath these nodes.
 +
 
 +
== Descendants ==
 +
The following nodes are permitted within {{Node|textframe}}s:
 +
 
 +
{| class="wikitable" style="margin: 1em auto 1em auto;"
 +
! scope="col" | Node Type
 +
! scope="col" | Description
 
|-
 
|-
|{{:SHIP:Property:textmodel:textbgcolor}}
+
|{{:SHIP:Node:constant|{{†}}}}
 
|-
 
|-
|{{:SHIP:Property:textmodel:textcolor}}
+
|{{:SHIP:Node:file|{{†}}}}
 
|-
 
|-
|{{:SHIP:Property:textmodel:textspacing}}
+
|{{:SHIP:Node:group|{{†}}}}
 
|-
 
|-
|{{:SHIP:Property:textmodel:textmultiline}}
+
|{{:SHIP:Node:listener|{{†}}}}
 
|-
 
|-
|{{:SHIP:Property:textmodel:textwrap}}
+
|{{:SHIP:Node:text|{{†}}}}
 
|-
 
|-
 +
|{{:SHIP:Node:variable|{{†}}}}
 
|}
 
|}
</onlyinclude>
+
{{†}}only these nodes are permitted ''directly'' underneath the {{Node|textframe}} node.
 +
 
 +
== Properties ==
 +
 
 +
The following [[SHIP:TextframeModel|Text Frame Model]] properties are available for the {{Node|textframe}} node, whether in the {{Node|layout}} or {{Node|resources}} area:
 +
{{:SHIP:BoxModel}}
 +
 
  
== Font Selection ({{Prop|textframemodel|textfont}}, {{Prop|textframemodel|textsize}}, {{Prop|textframemodel|textstyle}}) ==
+
The following [[SHIP:TextModel|Text Model]] properties are available for the {{Node|textframe}} node, whether in the {{Node|layout}} or {{Node|resources}} area:
 +
{{:SHIP:TextModel}}
  
== Alignment ({{Prop|textframemodel|textdirection}}, {{Prop|textframemodel|texthalign}}, {{Prop|textframemodel|textvalign}}) ==
+
In addition, the following properties are also available, whether in the {{Node|layout}} or {{Node|resources}} area:
  
{| class="wikitable" style="margin: 1em auto 1em auto;"
+
{{PropTableStart|Other {{Node|textframe}} Properties}}
|[[Image:TextModelAlignmentOverview.png|500px|center|Text Frame Model Alignment Overview]]
+
|{{:SHIP:Property:displayable:visible}}
 +
|-
 +
|{{:SHIP:Property:displayable:opacity}}
 +
|-
 +
|{{:SHIP:Property:all:name}}
 +
|-
 +
|{{:SHIP:Property:textframemodel:direction}}
 +
|-
 
|}
 
|}
  
== Colors ({{Prop|textframemodel|textcolor}}, {{Prop|textframemodel|textbgcolor}}) ==
+
{{Node|textframe}} nodes in the {{Node|layout}} area also have the following properties:
  
== Inheritance Model ==
+
{{PropTableStart|Other {{Node|textframe}} in {{Node|layout}} Area Properties}}
 
+
|{{:SHIP:Property:box:object}}
When a piece of {{Node|textframe}} is rendered, each of the [[SHIP:TextframeModel|Text Frame Model]] properties is determined by the following prioritized inheritance rules:
+
|-
 +
|{{:SHIP:Property:box:over}}
 +
|-
 +
|{{:SHIP:Property:layoutarea:enabled}}
 +
|-
 +
|}
  
# Any property specification on the {{Node|layout}} {{Node|textframe}} node itself
+
== Examples ==
# Any attached object with the property specified
 
# The nearest displayable parent node's determination of that property
 

Revision as of 17:26, 21 October 2016

Node Home

Node Type Description
textframe A generic text container, available as a reusable resource or layout element.

The textframe node is the generic text container used to position and enclose other text nodes. They can be nested, stacked, and overlapped. Touch events can be sensed within them. They can be invisible, partially tranparent, or fully opaque. And they have all the properties of the TextframeModel, including margin, borders, padding, and more.

textframe nodes can exist in the layout area or the resources area. In the resources area, the textframe forms a template of properties that can be inherited by a textframe in the layout area.

Ancestors

The following nodes are permitted to have textframes as descendants:

Node Type Description
box A generic rectangular container, available as a reusable resource or layout element.
frame A generic lightweight rectangular container, available as a reusable resource or layout element. Introduced in 5.0.207.
layout Top of the Layout Area within a SHIP GUI, which completely describes how the GUI is visually organized.
page Visual layout area for a specific GUI "page", or "screen"
textframe Defines a textframe resource or a visual text representation.

textframe nodes are permitted directly underneath these nodes.

Descendants

The following nodes are permitted within textframes:

Node Type Description
constant Defines a constant value for use in SHIPTide properties or SAIL scripts.
SHIP:Node:file
group Lightweight node that encloses other nodes for pure organizational benefit, or to create an array of nodes.
listener Monitors one or more properties (including variable values!) for changes, and on changes invokes a script.
text Defines a text resource or a visual text representation.
variable Run-time value accessible by scripts and able to generate events on change.

only these nodes are permitted directly underneath the textframe node.

Properties

The following Text Frame Model properties are available for the textframe node, whether in the layout or resources area:

Box Model Outer Properties
Property Data Type Description
ot Dimension Top edge of a box model node.
ob Dimension Bottom edge of a box model node.
oh Dimension Height of a box model node.
ol Dimension Left edge of a box model node.
or Dimension Right edge of a box model node.
ow Dimension Width of a box model node.
Box Model Vertical and Horizontal Alignment Properties
Property Data Type Description
valign VALIGN Vertical alignment of a box model node within its parent container's inner dimensions.
halign HALIGN Horizontal alignment a box model node within its parent container's inner dimensions.
Box Model Margin Properties
Property Data Type Description
mt Dimension Top margin thickness of a box; not present on lightweight box model nodes such as frame and textframe.
mb Dimension Bottom margin width of a box; not present on lightweight box model nodes such as frame and textframe.
ml Dimension Left margin width of a box; not present on lightweight box model nodes such as frame and textframe
mr Dimension Right margin width of a box; not present on lightweight box model nodes such as frame and textframe
Box Model Border Properties
Property Data Type Description
bt Dimension Top border thickness of a box; not present on lightweight box model nodes such as frame and textframe.
bct Color Top border color of a box; not present on lightweight box model nodes such as frame and textframe.
bb Dimension Bottom border thickness of a box; not present on lightweight box model nodes such as frame and textframe.
bcb Color Bottom border color of a box; not present on lightweight box model nodes such as frame and textframe.
bl Dimension Left border thickness of a box; not present on lightweight box model nodes such as frame and textframe.
bcl Color Left border color of a box; not present on lightweight box model nodes such as frame and textframe.
br Dimension Right border thickness of a box; not present on lightweight box model nodes such as frame and textframe.
bcr Color Right border color of a box; not present on lightweight box model nodes such as frame and textframe.
Box Model Padding Properties
Property Data Type Description
pt Dimension Top padding thickness of a box; not present on lightweight box model nodes such as frame and textframe.
pb Dimension Bottom padding thickness of a box; not present on lightweight box model nodes such as frame and textframe.
pl Dimension Left padding thickness of a box; not present on lightweight box model nodes such as frame and textframe.
pr Dimension Right padding thickness of a box; not present on lightweight box model nodes such as frame and textframe.
Box Model Inner Dimension Properties
Property Data Type Description
it Dimension Inner area top coordinate of a box model node relative to the display.
ib Dimension Inner area bottom coordinate of a box model node relative to the display.
ih Dimension Inner area height of a box model node.
il Dimension Inner area left coordinate of a box model node relative to the display.
ir Dimension Inner area right coordinate of a box model node, relative to the display.
iw Dimension Inner area width of a box model node.
Box Model Background, Fill, Inner Color Properties
Property Data Type Description
bgcolor Color Background color of a Box Model Node, filling the container completely to the outer edges.
fillcolor Color Fill color of a box, filling the box completely within the margin area; not present on lightweight box model nodes such as frame and textframe.
innercolor Color Inner color of a box, filling the box completely within the inner area after padding is applied; not present on lightweight box model nodes such as frame and textframe.
Box Model Attached Image/Canvas Offset Properties
Property Data Type Description
xoffset Dimension The horizontal offset of an attached image or canvas within the inner area of a a Box Model Node. May be positive or negative or 0.
yoffset Dimension The vertical offset of an attached image or canvas within the inner area of a a Box Model Node. May be positive or negative or 0.


The following Text Model properties are available for the textframe node, whether in the layout or resources area:

TextModel Property Summary
Property Data Type Description
textfont FontFamilyInfo Font family selector for displayable text.
textsize Dimension Pixel height selector for displayable text.
textstyle FONTSTYLE Style selector for displayable text.
texthalign HALIGN Horizontal alignment of text within its parent container's inner dimensions.
textvalign VALIGN Vertical alignment of text within its parent container's inner dimensions.
textbgcolor Color The background color of displayable text.
textcolor Color The color of displayable text.
textspacing Float A multiplier of the line spacing, with default unset value of 1.0f.
textmultiline Boolean Determines if a text line is permitted to overflow to the next line. The default (unset) is true.
textwrap Boolean Determines if a text line is permitted to automatically wrap to the following line if it will not fit on the current line. The default (unset) is true.


In addition, the following properties are also available, whether in the layout or resources area:

Other textframe Properties
Property Data Type Description
visible Boolean If true (default) this node will be visible iff all direct line parent nodes up to and including the display node are also visible.
opacity Byte Opacity of the displayable node and all its children, grandchildren, etc.
name** String The name used to identify this node in SHIPTide.
SHIP:Property:textframemodel:direction

textframe nodes in the layout area also have the following properties:

Other textframe in layout Area Properties
Property Data Type Description
object Reference:box,image Attaches to the box another object from the resources area, typically an image.
over Boolean If true the touchscreen is currently pressed within the bounds of the outer area of the box.
enabled Boolean If true (default) this node and its children are able to receive events.

Examples