Skip to main content

Image & Shape Resources

Image

Image

Image defines a named image resource.

skin.xml Snippet:

<Image name="BG1" url="images/BG1.png"/>

<Form name="ImageBackgroundTest" image="BG1">
<!-- Form content -->
</Form>
Attribute NameDescriptionType
adaptive-flag
durationTotal animation cycle time.time
framesFrame sequence.token
imageReferenced Image resource.identifier
marginImage margin.tuple
nameReferenced Image resource / slot key.identifier
sizeImage size geometry.tuple
template-flag
tileTiling mode.token
urlAsset path for the image resource.identifier
adaptiveDescription
true-
framesDescription
normalDefault image frame.
normalOnOn-state frame.
normal0 normal1 normal2-
t: *x* *Tiled sprite-sheet frame expression.
templateDescription
true-
nameDescription
backgroundUniversal slot; primary image for any styled control.
buttonDropdown button arrow for SelectBox.
disabledoverlayDisabled-state overlay for Knob.
firstLeft segment for TabView.
foregroundOverlay image for Knob and ActivityIndicator.
hBackHorizontal track background for Slider.
hHandleHorizontal drag handle for Slider.
iconOverlay icon for Button and Toggle.
lastRight segment for TabView.
middleCenter segment for TabView.
overlayFilmstrip indicator for Knob.
singleSingle segment for TabView.
topoverlayColor-tint mask for Knob.
vBackVertical track background for Slider.
vHandleVertical drag handle for Slider.
vSmallBackVertical scrollbar track for ScrollView.
vSmallThumbVertical scrollbar thumb for ScrollView.
tileDescription
repeat-xy-
stretch-xy-
stretch-y-
tile-x-
tile-xy-

Notes

  • url is used for image assets such as PNG and SVG files in the package.
  • For t: sprite sheets, 3x3 is the sprite-sheet grid size and the value after the space is the active frame count. In t: 3x3 8, the animation plays frames 1 through 8 and then loops back to 1.
  • duration sets the total time for one full animation cycle across the active frames.
  • When used inside <Style> blocks, <Image> can assign a resource to an engine-recognized slot. The name attribute is a slot key the control renderer looks for.

ImagePart

ImagePart defines a named crop or state frame from an Image resource, used for atlas slicing and button/state graphics.

skin.xml Snippet:

<Image name="ButtonOffImage">
<ImagePart name="normal" image="ButtonStateSheet" size="0,0,120,36"/>
</Image>

<Image name="ButtonHoverImage">
<ImagePart name="normal" image="ButtonStateSheet" size="0,36,120,36"/>
</Image>
Attribute NameDescriptionType
durationTotal animation cycle time.time
framesFrame/state sequence.token
imageReferenced Image resource name.identifier
marginCrop margin.tuple
nameImagePart resource name.identifier
sizeCrop geometrytuple
tileTiling mode.token
template--
urlAsset path for the image part.-
framesDescription
darkframe-
disabled-
h:Horizontal frame set prefix.
lightframe-
mouseover-
mouseoverOn-
normal-
normalOn-
phaseOn-
pressed-
v:Vertical frame set prefix.
disabledOn-
normal0-
normal1-
normal2-
pressedOn-
small-
tileDescription
repeat-x-
repeat-xy-
repeat-y-
stretch-xy-
stretch-y-
tile-x-
tile-xy-
tile-y-

Notes

  • ImagePart is used to carve out a sub-rectangle from a named image resource, including button-state atlases and other sliced UI image sheets.
  • The wrapped Image name is what other controls consume; the ImagePart supplies the cropped state slice inside it.

ImageFilter

ImageFilter defines a named filter for an ImagePart.

skin.xml Snippet:

<ImageFilter name="colorize" color="hsl(220,80,45)"/>
Attribute NameDescriptionType
nameFilter type.token
colorFilter color value.color
valueNumeric filter value.number
nameDescription
blendBlend filter.
colorizeColorize filter.
lightadapt-
tintTint filter.

Shape

Shape

Shape defines one named vector object inside a top-level Shapes block.

skin.xml Snippet:

<Shape name="RoundedSquareShape" size="0,0,48,48" style="scale">
<Rectangle size="4,4,40,40" style="fill stroke tiled margin"
Brush.color="hsl(204,11,64)"
Pen.color="hsl(0,0,12)"
Pen.width="2"
radius="6"/>
</Shape>
Attribute NameDescriptionType
nameShape resource name.identifier
sizeSize geometry.tuple
style-token
nameDescription
disabled-
focus-
mouseover-
normal-
normalOn-
pressed-
pressedOn-
styleDescription
scale-

ShapeImage

ShapeImage exposes a named Shape as an image resource.

skin.xml Snippet:

<ShapeImage name="RoundedSquareIcon" url="RoundedSquareShape"/>
Attribute NameDescriptionType
adaptive-flag
nameShapeImage resource name.identifier
margin-tuple
urlReferenced Shape name.identifier
frames-number
template-token
adaptiveDescription
true-
framesDescription
embedded-
nameDescription
mouseover-
mouseoverOn-
normal-
normalOn-
pressed-
pressedOn-

Rectangle

Rectangle is a rectangle primitive used inside Shape.

skin.xml Snippet:

<Rectangle size="4,4,40,40" style="fill stroke tiled margin"
Brush.color="hsl(204,11,64)"
Pen.color="hsl(0,0,12)"
Pen.width="2" radius="6"/>
Attribute NameDescriptionType
sizePosition and size geometry.tuple
styleRectangle drawing style.token
Brush.colorFill color.color
Brush.gradientFill gradient reference.identifier
Pen.colorStroke color.color
Pen.widthStroke width.number
radiusRounded corner radius.number

style

ValuesDescription
fillEnable fill.
margin-
scale-
strokeEnable stroke line.
tiled-

Triangle

Triangle is a triangle primitive used inside Shape.

skin.xml Snippet:

<Triangle point1="24,6" point2="42,40" point3="6,40" style="fill stroke" 
Brush.color="hsl(204,11,64)"
Pen.color="hsl(0,0,12)"
Pen.width="2"/>
Attribute NameDescriptionType
point1First triangle point.tuple
point2Second triangle point.tuple
point3Third triangle point.tuple
styleTriangle drawing style.token
Brush.colorFill color.color
Pen.colorStroke color.color
Pen.widthStroke width.number
nameDescription
normal-

style

ValuesDescription
fillEnable fill.
strokeEnable stroke line.

Notes

  • point1 point2 point3 use two value-tuple "x,y".

Ellipse

Ellipse is an ellipse/circle primitive used inside Shape.

skin.xml Snippet:

<Ellipse size="6,6,36,36" style="fill stroke" 
Brush.color="hsl(204,11,64)"
Pen.color="hsl(0,0,12)"
Pen.width="2"/>
Attribute NameDescriptionType
sizePosition and size geometry.tuple
styleEllipse drawing style.token
Brush.colorFill color.color
Pen.colorStroke color.color
Pen.widthStroke width.number

style

ValuesDescription
fillEnable fill.
strokeEnable stroke line.

Line

Line is a line primitive used inside Shape.

skin.xml Snippet:

<Line start="0,0" end="10,0" style="stroke"
Pen.color="hsl(204,11,64)"
Pen.width="2"/>
Attribute NameDescriptionType
startLine start point.tuple
endLine end point.tuple
styleLine drawing styles.token
scalealign-token
Pen.colorStroke color.color
Pen.widthStroke width.number
styleDescription
strokeEnable stroke line.
tiled-
scalealignDescription
bottom-
right-

Notes

  • start and end use a two-value tuple "x,y"