The interface isn't really flexible enough to support his officially yet. I'd need something like Lua scripting, too, to make it really general purpose. Still, there is enough there that you can try out and share new ideas with me and other modders.
Tips:
- There are some really important comments at the top of the file that I would urge you to get a good understanding of before attempting any changes. Once you get a good feel for the way type, inherit, and find interact with one another you shouldn't have any trouble at all.
- Generally you can shimmy things around inside and out of different containers. The code uses a recursive search to find a UI element no matter where it is in its parent... that said, this is all unofficial so if you break it, you buy it.
- It's probably a good idea to leave id's alone. They're almost always used as a key for something. If it's only for inheritance inside of ui.xml, it's safe (though a little scary) to change, but if it's anything Synthesia checks for by name, it has to be there or you'll get a crash.
- "tid" is a special attribute whose value will be used to look up text from the current language and be treated like a "text" attribute.
Code: Select all
Things that can anchor/stretch in both directions
- Frame
- Spacer
- Image
- Button
- DataGrid
- LineChart
- ScrollContainer
- DistributedLayout
- MovingOutline (NOT YET IMPLEMENTED!)
Things that can stretch in one direction:
- FlowLayout
- Breadcrumb
- Keyboard
- Label (when maxWidth is set, only changes maxWidth)
- GridLayout (either, based on direction, but only one at a time)
- TextBox (NOT YET IMPLEMENTED)
Types used below
----------------
- string: a simple set of UTF-8 characters (ui.xml assumes UTF-8 encoding)
- bool: 0 for false, 1 for true
- color: the id from a color defined in colors.xml
- float: a number that can have a decimal point
- int: a number that can't
- texture: the name of one of the .tga resources included in the executable (external image loading isn't supported yet!)
Recognized Style Properties (Specified using "attributeName : type, default")
---------------------------
(All elements):
- id : string, ""
- layer : int, 1
- type : button|label|image|window|etc.
- inherit : id of some previously defined control
- find : id of a control that should exist at this level
- position : vector<float>(2), (0,0)
- color : color, White
- sensitive : bool, 1
- visible : bool, 1
- align : pair of: [left|center|right] and [top|center|bottom] second part optional, "left, top"
- anchor : pair of: [none|left|right|both] and [none|top|bottom|both] second part optional, "left, top"
containers like frame/flowLayout/gridLayout/etc.:
- childrenSensitive, bool, 1
label:
- text : string, ""
- fontSize : float, 14
- fontEffect : none|shadow|outline, none
- maxWidth : float, -1
- wrap : float, -1
frame
- size : vector<float>(2), (0,0)
- autoSizePadding : vector<float>(2), (-1, -1)
spacer
- size : vector<float>(2), (0,0)
image:
- size : vector<float>(2), (0,0)
- texture : texture, (none)
- uv : vector<float>(4), (-1,-1,-1,-1)
- hitTest : bool, 0
window (+ frame):
- size : vector<float>(2), (0,0)
- textureBorder : float, 5
- textureFromEdge : float, 1
- background : texture, ui_window
- backgroundOverlay1 : texture, ui_window_overlay1
- backgroundOverlay2 : texture, ui_window_overlay2
- hr : float (repeatable)
button:
- size : vector<float>(2), (0,0)
- text : string, ""
- textAlign : left|center|right, center
- textureBorder : float, 5
- textureFromEdge : float, 1
- background : texture, ui_window
- backgroundOverlay1 : texture, ui_window_overlay1
- backgroundOverlay2 : texture, ui_window_overlay2
- fontSize : float, 14
- fontEffect : none|shadow|outline, none
- fontColor : color, White
- fontColorHover : color, White
- colorHover : color, White
- image : texture, (none)
- imageColor : color, White
- imageAlign : left|center|right, left
- hoverShimmy : bool, 1
- textPadding : float, 3
- autoWidthPadding : float, -1
flowLayout:
- padding : float, 0
- direction : horizontal|vertical, vertical
- excludeHidden : bool, 0
distributedLayout:
- size : vector<float>(2), (0, 0)
- maxSpacing : float, 0
- direction : horizontal|vertical, vertical
- excludeHidden : bool, 0
- extentsArePadded: bool, 0
groupedTable (+ window):
- labelTemplate
- detailTemplate
- checkmarkColor
- disclosureColor
- asteriskColor
textbox:
- width : float, 0 (none)
- text : string, ""
- fontSize : float, 14
- fontEffect : none|shadow|outline, none
- emptyHint : string, "", looks up a text ID like "tid" attribute
- maxLength : int, 0 (no limit)
- passwordMask : bool, 0
- textPadding : float, 3
- fontColor : color, Black
- hintColor : color, Black
popup (+ frame):
- texture : texture, ui_popup_arrow
- color : color, White
- padding : float, 32, space between popup and source
- arrowOffset : float, 16, arrow is drawn at (edge - arrowOffset)
breadcrumb:
- maxWidth : float, 0
- fontSize : float, 14
- fontColor : color, White
- fontColorHover : color, White
- labelBackground : color, Transparent
- labelBackgroundHover : color, Transparent
pagedDataGrid:
- rowHeight, float, 10
scrollingDataGrid:
- size : vector<float>(2), (0,300), width is ignored for now and still calculated by column widths
- mode : display|selectable, display
- headerFontColor : color, White
- rowBackgroundColor : color, Transparent
- rowBackgroundAlternatingColor : color, Transparent
- rowBackgroundSelectedColor : color, White
- fontColor : color, White
slider:
- size : vector<float>(2), (20, 20)
- foreground : texture, (none)
- background : texture, (none)
- foregroundColor : color, White
- backgroundColor : color, White
- minValue : double, 0
- maxValue : double, 100
- value : double, 0
- splitter : texture, (none)
- splitterWidth : float, 0
- step : double, 0
- immediateUpdate : bool, false
keyboard:
- width : float, 100
scrollContainer:
- size : vector<float>(2), (0,0)
- horizontal : never|normal|always, normal
- vertical : never|normal|always, normal
- scrollbar : color, White
- scroller : color, White
- scrollerHover : color, White
switch:
- color : color, White, for the round sliding part of the switch
- foregroundColor : color, White, the oval filled color when the switch is turned on
- backgroundColor : color, Black, the oval border/stroke color when the switch is turned off
segmentButton:
- size : vector<float>(2), (0,0), width ignored, auto-sized using padding
- textureBorder : float, 0
- textureFromEdge : float, 0
- texture : texture, (none)
- activeColor : color, White
- backgroundColor : color, Black
- shadowColor : color, Black
- padding : float, 4
gridLayout:
- padding : float, 0
- fixedDimension : float, 100
- excludeHidden : bool, 0
- direction : horizontal|vertical, vertical
- childLayout : english|asian|rightToLeft, english
numericLabel:
- numericText : string comprised of {0123456789 .,:-+/%()x}, ""
Spoiler: