Skip to content

MASMonitor

MOARdV edited this page Jun 12, 2018 · 61 revisions

The MASMonitor prop module powers monitor displays ranging from simple single-line digital readouts to full-featured MFDs. MASMonitor is more complex to set up than a MASComponent, since it entails a render texture and multiple pages. The MASMonitor is comparable to the RasterPropMonitor class, but it is substantially more flexible in its design.

Each monitor may have a startupScript specified. When present, MAS will execute this script when the vessel is loaded (for instance, switching to the vessel, or launching the vessel). This script will be executed each time the vessel is loaded, so it can be used to initialize important variables, or to check the state of the vessel or important values.

When placing components in a monitor, the upper left corner is treated as the origin (0, 0), and positive Y is "down" on the display. For graphical components, displacement is by pixel, while text displacement is by character (based on the fontSize).

MODULE
{
  name = MASMonitor

  screenTransform = FlatMon40x10Screen
  //layer = _Emissive
  screenSize = 512, 512
  font = InconsolataGo
  style = Bold
  fontSize = 16, 32
  textColor = 255, 255, 255, 255
  backgroundColor = 0, 0, 32, 255
  monitorID = %AUTOID%
  //startupScript = MAS_InitializeMe()

  //++ TODO
  //variable = blah
  //range = blah
  //disabledColor = blah ?
  //-- TODO

  page = Standby_Page
  page = Orbit_Page
  ...
}

The configuration parameters are

  • screenTransform: Required. The name of the transform in the prop that contains a screen display.
  • layer: Optional. Defaults to '_Emissive'. A space-separated list of the layers in 'screenTransform' that will be rendered to.
  • screenSize: Required. The width and height of the render texture that the monitor will use.
  • font: Required. The name of the Fonts (bundled, system, or user) that is used for rendering text.
  • style: Optional. Defaults to 'Normal'. The font style to use rendering the default font. May be one of 'Normal', 'Bold', 'Italic', or 'BoldAndItalic'.
  • fontSize: Required. The width and height of the text that is rendered on the monitor, in screen pixel size. All texts will be fixed-width, even if the referenced font is not.
  • textColor: Required. The default color of text rendered on the screen. Colors may be overridden with tags (see Formatted Rich Text).
  • backgroundColor: Required. The color the monitor will be cleared to before rendering.
  • page: Required. One or more entries referring to named pages that are displayed on the monitor. Pages may be omitted, in which case the monitor won't do anything. The first listed page is the default page that is visible when first entering IVA.
  • monitorID: Optional. Defaults to '%AUTOID%'. Specifies the name of the persistent variable used to contain the current page selection. Defaulting to %AUTOID% allows on-prop buttons to likewise use %AUTOID%, but a unique name might be better for a monitor controlled by props located elsewhere.
  • startupScript: Optional. Allows the prop designer to specify a script that is executed while MAS configures the prop.

CAUTION: Only use one MASMonitor per prop. Multiple MASMonitor modules will lead to incorrect behavior.

Softkeys

Many MFDs contain softkeys that have different effects depending on the active page. To support this capability in MAS, there is an action fc.SendSoftkey(monitorName, softkeyNumber) (see). This action sends a number to the monitor whose monitorID is set to monitorName.

If the currently-active page on the given monitor includes a softkey field corresponding to the softkeyNumber (see the next section), then the page will trigger the listed action. If there is no softkey field for the given number, then the key event is passed to each of the components of that page. At present, only RPM_MODULE components will consume a softkey event, although future modules may do so, as well.

Pages

MAS_PAGE
{
  name = Standby_Page

  //softkey = 0, fc.SetPersistent("%AUTOID%", "MAS_ALCOR_MFD_A_Land")
  //softkey = 1, fc.SetPersistent("%AUTOID%", "MAS_ALCOR_MFD_A_Launch")
  ...

  //onEntry = CustomPageEntry("%AUTOID%")
  //onExit = CustomPageExit("%AUTOID%")
}

Monitor pages are defined in config files using the MAS_PAGE node type. Each page must have a name. A page may have one or more nodes inside it describing the page layout (text, graphical objects, etc). These nodes are layered during rendering, with the first node listed being the farthest from the camera. If a page has no nodes, it will result in a completely blank page.

Individual nodes may be optionally disabled and enabled by querying a variable, in much the way that MASComponent actions use variables. Page nodes only support the Boolean and Threshold Modes.

In addition to the component nodes, a page may have a number of softkey = entries. Each of these entries map a softkey number to an action, allowing each page on the MFD to have customizable behavior attached to soft keys.

Each page may include one or both of the optional onEntry and onExit entries. Each of these entries references an action (either a MAS function or a custom script) that is executed when the page becomes active (for onEntry) or becomes no longer active (onExit). The onEntry action is called for the default page when the craft is first loaded, and for every active page when the craft is reloaded. The onExit action is called when switching to a new page, prior to the new page's onEntry call. This feature could be used, for instance, to allow the new page to know which page was previously active, allowing a "back" feature.

Because fonts are treated as fixed-width, there is the possibility that scaling problems will cause unusually-wide characters to be compressed horizontally, which may hinder readability. This problem may be worse if the [hw] tag is used with those fonts.

Pages are selected by setting the persistent identified by monitorID to the name (string) of the desired page. In the example config above, for instance, a button on the same prop could use fc.SetPersistent("%AUTOID%", "Orbit_Page") to select the second page in the list.

CAMERA

The Camera node renders the view from cameras on board the vessel. Such cameras can be used for docking, or inspecting the exterior of the craft, or surveying things from a distance. The camera objects are created by adding a MASCamera module to a part and correctly configuring it.

Cameras are accessed by name, and each camera should have a unique name. To allow some generalization in monitor configuration, the MASFlightComputer has methods that allow cameras to be addressed by number, but MAS makes no guarantees on the ordering of those cameras.

For the most efficient use of memory, the size of the camera should be a power-of-2 (64, 128, 256, 512). It does not have to be square. For instance, a 512 x 256 size is okay.

CAMERA
{
	name = ActionCam
	position = 0,0
	size = 256, 256
	camera = "MyActionCam"
	//camera = fc.GetCameraName(0)
	//camera = fc.GetPersistent("My-Active-Camera-Variable")
	//variable = fc.GetPersistentAsNumber("ShowCamera")
	//range = 0.5, 1.1
	//missingTexture = ""
}
  • name: Optional. Default '(anonymous)'. A name for the node.
  • position: Required. The location on the monitor where the upper-left corner of the camera view will be placed.
  • size: Required. The size of the camera view.
  • camera: Required. Identifies which camera should be rendered. If an invalid name is provided, nothing is rendered.
  • variable: Optional. When present, the variable will control whether the horizon is rendered or not.
  • range: Optional. Ignored if 'variable' is not present. When present, the 'variable' operates in Threshold Mode; when absent, the 'variable' operates in Boolean Mode.
  • missingTexture: Optional. The 'missingTexture' provides the URI to a texture that should be displayed if MAS is unable to find the selected camera. This "missing camera" texture is also displayed when the active camera is no longer available (for instance, if it is lost due to staging or undocking).

COMPOUND_TEXT

A Compound Text node allows multiple lines of text to be displayed, with a separate variable controlling whether each line is visible. This feature could be used to provide a checklist, with text disappearing when a given task is completed. It could also be used for a prioritized alert system, with higher-priority warnings displayed above lower-priority warnings.

While such a capability can be accomplished using a TEXT node, the results would have blank lines scattered about. COMPOUND_TEXT will move text lines together to prevent blank lines in the middle of the text region. It can also be configured to show a maximum number of lines of text, so the display can be used in a limited space with only high-priority information visible.

As an attempt to illustrate this, say there vessel has several different alarms. There are URGENT alarms, IMPORTANT alarms, WARNING alarms, and NOTIFICATION alarms. Using a TEXT node for each category, the MFD would have four rows of text:

URGENT
IMPORTANT
WARNING
NOTIFICATION

If only the URGENT and NOTIFICATION alerts were active, the display would look like

URGENT


NOTIFICATION

If you later want to add a VERY IMPORTANT alert, you would need to resize the space you're setting aside on-screen for these notices to have five rows of text, potentially wasting valuable screen space when most of them aren't visible.

With Compound Text, the URGENT and NOTIFICATION alerts would be displayed as

URGENT
NOTIFICATION


instead.

In this example, it's not that big of an improvement. But, the COMPOUND_TEXT can be told to limit the number of items it will display. Instead of using four lines to display the four alert categories, COMPOUND_TEXT could be told to display only two lines, so the alerts would appear as

URGENT
NOTIFICATION

If an IMPORTANT alert triggered, the display would contain

URGENT
IMPORTANT

because the NOTIFICATION is a lower-priority message, and the Compound Text was configured to display only the top two texts.

A Compound Text node should contain at least one TEXT child node, but it's intended to contain many (MAS does not impose a limit).

COMPOUND_TEXT
{
  name = testCT
  position = 0, 3
  maxLines = 4
  //font = 
  //style = 
  //fontSize = 
  //textColor = 
  //variable = fc.GetPersistentAsNumber("ShowCompoundText")
  //range = 0.5, 1.1

  TEXT
  {
    name = node1
    text = Rcs ON: <=0:0=> $&$ fc.AltitudeTerrain(false)
    variable = fc.GetRCS()
    //range = 
  }
}
  • name: Optional. Default '(anonymous)'. A name for the node.
  • position: Optional. Default (0, 0). An offset from the upper-left corner for the text being rendered. The offset is in units of character columns and rows, not pixels. The row and column size is based on the 'fontSize' of the MASMonitor, not the optional 'fontSize' specified in the COMPOUND_TEXT node.
  • maxLines: Required. Tells MAS the maximum number of lines to display.
  • font: Optional. The name of the font to use for rendering this text. If this parameter is omitted, the font listed in the MASMonitor config section is used.
  • style: Optional. Default 'Normal'. The style of font to use, if available. Valid options are Normal (the default), Bold, Italic, and BoldAndItalic. Note that the use of Formatted Rich Text tags that change the style will override the style field.
  • fontSize: Optional. The width and height of this text as rendered on the screen, in pixels. If it is omitted, the default from MASMonitor is used.
  • textColor: Optional. The default text color for this text. If the entry is omitted, the default found in MASMonitor is used.
  • variable: Optional. When present, the variable will control whether any of the compound text is rendered or not.
  • range: Optional. Ignored if 'variable' is not present. When present, the 'variable' operates in Threshold Mode; when absent, the 'variable' operates in Boolean Mode.

In addition, each Compound Text node contains child TEXT nodes (possibly many). These describe the text that is displayed, the conditions to display that text, and the priority of the text (TEXT nodes listed earlier take priority over TEXT nodes listed later). The 'text' entry for each TEXT node should be a single line of text (no '$$$' line breaks), since MAS can not track line breaks embedded in the 'text' field. If multiple lines of text are needed, list each one as a separate TEXT node using the same 'variable' and 'range' settings.

  • name: Optional. Default '(anonymous)'. A name for the TEXT child node.
  • text: Optional. If not present, will insert a blank line, allowing space between different categories of notices. When present, this is the text that is displayed when this TEXT child node is visible.
  • variable: Optional. When present, the variable will control whether this text is rendered or not. When missing, this text is always visible.
  • range: Optional. Ignored if 'variable' is not present. When present, the 'variable' operates in Threshold Mode; when absent, the 'variable' operates in Boolean Mode.

ELLIPSE

An Ellipse node draws a closed line string around a center location, appearing as a circle (when both the X and Y radius are the same) or an ellipse (when the radii differ). The ellipse is extremely configurable, allowing variables to alter the start color and line width, as well as end color and line width.

Ellipses may also use a texture to apply effects, such as a dotted line. The texture is applied with the U coordinate increasing between vertices, while the V coordinate increases across the width of the line. MAS adjusts the texture scale to attempt to keep the displayed texture at a 1:1 scale along the U direction (that is, if the texture is 32 pixels long, MAS will try to adjust the texture's scaling so it repeats every 32 pixels of line length).

A start angle and end angle may be optionally supplied. Either or both may be variables. These values describe the portion of the ellipse that should be rendered, allowing for circular gauges to be simulated, for instance. An angle of 0 points directly at the right side of the screen (+X), and an angle of 90 points at the top of the screen (-Y). Yes, this is a right-handed coordinate system being used on the screen's left-handed coordinate system.

In the example below, if startAngle and endAngle were uncommented, the ellipse would grow clockwise in response to increasing throttle, until it covered a 270 degree angle. Note that angle increases anti-clockwise.

There is no arbitrary limit to the number of vertices that can be used in an ellipse.

ELLIPSE
{
	name = Some round lines

	position = 256, 256
	//texture = path/to/texture

	startColor = 155, 255, 155, 255
	endColor = fc.GetThrottle() * 155, 255, 0, 255
		
	startWidth = 3.5
	//endWidth = 4.5
		
	vertexCount = 32

	radiusX = 5.0
	//radiusY = 5.0
		
	//startAngle = 180
	//endAngle = 180 - 270*fc.GetThrottle()

	//variable = 1
	//range = 0.5, 1.5

	//rotation = fc.GetRoll()
}
  • name: Optional. Default '(anonymous)'. A name for the node.
  • position: Required. The pixel offset from the upper-left corner of the page for the origin of the ellipse.
  • texture: Optional. A URI to a texture that will be applied to the lines of the ellipse.
  • startColor: Required. The color of the ellipse at the first vertex (directly to the right when not rotated). The line will smoothly blend from this color to 'endColor'.
  • endColor: Optional. Defaults to 'startColor'. The color of the ellipse at the last vertex, once it has wrapped around the origin.
  • startWidth: Required. The width of the line string (in pixels) at the first vertex. The line will smoothly blend from this width to 'endWidth'.
  • endWidth: Optional. Defaults to 'startWidth'. The width of the line string (in pixels) at the last vertex.
  • vertexCount: Required. Must be at least 3. Determines the number of vertices used to create the ellipse (more vertices results in a higher quality curve, but it also increases the overhead of creating the ellipse).
  • radiusX: Required. Describes the radius of the ellipse along the horizontal (X) axis.
  • radiusY: Optional. Describes the radius of the ellipse along the vertical (Y) axis. When omitted, radiusY = radiusX, creating a circle.
  • startAngle: Optional. Required if endAngle is included. Defaults to 0. The starting angle, in degrees, of the arc to draw, assuming rotation is 0. An angle of 0 points directly at +X (the right side of the screen), and an angle of +90 points towards the top of the screen (-Y).
  • endAngle: Optional. Required if startAngle is included. Defaults to 360. The ending angle, in degrees, of the arc to draw, assuming rotation is 0. An angle of 0 points directly at +X (the right side of the screen).
  • variable: Optional. When present, the variable will control whether this line string is rendered or not.
  • range: Optional. Ignored if 'variable' is not present. When present, the 'variable' operates in Threshold Mode; when absent, the 'variable' operates in Boolean Mode.
  • rotation: Optional. When present, the 'rotation' variable will rotate all of the line strings around 'position'.

GROUND_TRACK

The Ground Track node provides orbital ground tracks suitable for display over a map. The Ground Track will render up to three different orbital tracks: the active vessel's current track, a target's track, and a post-maneuver node orbital track.

GROUND_TRACK
{
	name = Ground track
	position = 0, 432
	size = 1024
	lineWidth = 5
	vertexCount = 32
	vesselColor = 71, 154, 151, 255
	targetColor = 192, 0, 192, 255
	maneuverColor = COLOR_XKCD_KSPNOTSOGOODORANGE

	startLongitude = fc.Longitude() - 180
	//variable = ShowGroundTrack()
}
  • name: Optional. Default '(anonymous)'. A name for the node.
  • position: Required. The pixel offset from the upper-left corner of the page for the origin of the ellipse.
  • size: Required. The width in pixels of the ground track's drawing area. The height of the ground track is always 1/2 of the width (2:1 aspect ratio).
  • lineWidth: Required. The width in pixels of the ground track's line.
  • vertexCount: Required. The number of vertices in the line. More vertices will result in smoother lines, but more processing work. For orbits with lower inclinations, 32 vertices is usually plenty.
  • vesselColor: Optional. The color to use to draw the current vessel's ground track. If this field is not present, the current vessel's ground track is not rendered.
  • targetColor: Optional. The color to use to draw the current target's ground track. If this field is not present, or there is no current target, or the current target is in a different sphere of influence, the target orbit is not drawn.
  • maneuverColor: Optional. The color to use to draw the resulting ground track after a scheduled maneuver. If this field is not present or there is no maneuver, the target orbit is not drawn.
  • startLongitude: Optional. Defaults to -180. The longitude that represents the left-most edge of the ground track. Using a variable (such as fc.Longitude() - 180 for this number allows for scrolling maps.
  • variable: Optional. When present, the variable will control whether the ground track is rendered.
  • range: Optional. Ignored if 'variable' is not present. When present, the 'variable' operates in Threshold Mode; when absent, the 'variable' operates in Boolean Mode.

HORIZON

The Horizon node renders an artificial horizon, such as would be found on aircraft. It is not intended to replace a navball for full 3D positional data, since it only provides visual roll and pitch cues. Note that both the pitch and roll variables are user configurable, so there is no requirement to use this feature strictly for those flight parameters.

The texture is treated like a Vertical Strip with the additional feature of being able to rotate the texture around the center of its displayed area. Texture coordinates are clamped, so for best results, the texture should have a one pixel wide border of whatever the background color should be.

HORIZON
{
	name = horizon
	texture = JSI/RasterPropMonitor/Library/Components/HUD/ladder
	position = 0,0
	size = 256, 256
	pitch = fc.Pitch()
	pitchRange = -90, 90
	displayPitchRange = 1536,512
	roll = fc.Roll()
	rollRange = -180,180
	displayRollRange = -180,180
	//variable = fc.GetBrakes()
	//range = 0.5, 1.1
}
  • name: Optional. Default '(anonymous)'. A name for the node.
  • texture: Required. The texture that will be used for the horizon.
  • position: Required. The location on the monitor where the center of the horizon will be placed.
  • size: Required. The size of displayed portion of the horizon.
  • pitch: Required. The variable that controls vertical texture movement.
  • pitchRange: Required. The range of values that will affect the horizon pitch. Values outside this range are clamped to this range.
  • displayPitchRange: Required. The pixel offsets from the top of the texture that correspond to the first and second 'pitchRange' values.
  • roll: Required. The variable that controls texture roll.
  • rollRange: Required. The range of valid roll values. Values outside this range are clamped to this range.
  • displayRollRange: Required. The range that the texture will be rotated. Maximum values should stay between [-180, +180] for a normal horizon.
  • variable: Optional. When present, the variable will control whether the horizon is rendered or not.
  • range: Optional. Ignored if 'variable' is not present. When present, the 'variable' operates in Threshold Mode; when absent, the 'variable' operates in Boolean Mode.

HORIZONTAL_BAR

A Horizontal Bar node renders a bar graph that grows or shrinks horizontally in response to the source variable. The bar graph may be a solid color, or it may use a texture. If a texture is used, the UV values are scaled in proportion to how full the bar is (in other words, the texture is not squished as the bar goes from full to empty), which allows a texture with a gradient or other pattern to be used.

HORIZONTAL_BAR
{
	name = G-Forces
	position = 16, 272
	size = 128, 32
	source = fc.GForce()
	sourceRange = 0, 5
	sourceColor = 192,192,128,255 // Optional, may be white for texture application.  Or not.
	//texture = AvionicsSystems/Textures/horiz_bargraph
	anchor = Left
	borderWidth = 2
	borderColor = 128, 64, 64,255
	//variable = fc.GetBrakes()
	//range = 0.5, 1.1
}
  • name: Optional. Default '(anonymous)'. A name for the node.
  • position: Required. The location on the monitor where the upper-left corner of the bar graph will be placed.
  • size: Required. The size of the graph. 'source**: Required. The variable that will be graphed.
  • sourceRange: Required. The values for the left and right ends of the bar.
  • sourceColor: Optional. Defaults to white. The color of the bar graph.
  • texture: Optional. When present, the named texture is drawn so it will fill the graphs area. Color textures may be used - the sourceColor is multiplied by the texture color in that case. If no texture is provided, the graph is treated as a solid color.
  • anchor: Optional. Defaults to 'Left'. Defines the anchor of the bar graph. 'Left' means the left side of the region, in which case the graph grows towards the right. 'Right' means the opposite: the graph starts on the right and it grows to the left. 'Middle' mwans the graph starts in the center, and it grows to the left if the source value is below 1/2 of the range, or it grows to the right if the source value is above 1/2 of the range.
  • borderWidth: Optional. Required if 'borderColor' is present. The width in pixels for a border surrounding the graph area. This border is placed outside the region specified by 'position' and 'size'. In the above example, the border is 2 pixels wide, which means it is in x-position 14-16 and 496-498.
  • borderColor: Optional. Required if 'borderWidth' is present. The color of the graph's border.
  • variable: Optional. When present, the variable will control whether this strip is rendered or not.
  • range: Optional. Ignored if 'variable' is not present. When present, the 'variable' operates in Threshold Mode; when absent, the 'variable' operates in Boolean Mode.

HORIZONTAL_STRIP

A Horizontal Strip node renders part of a texture in response to a variable input. It can be used for a virtual compass instrument or other applications. The full height of the source texture is always displayed in a horizontal strip, but only a portion of the width is visible at any given time.

HORIZONTAL_STRIP
{
	name = Heading
	texture = JSI/RasterPropMonitor/Library/Components/NavBall/hdg2
	position = 448,20
	size = 128,24
	input = fc.Heading()
	inputRange = 0, 360
	displayRange = 0,1024
	displayWidth = 128
	//wrap = false
	//variable = fc.GetBrakes()
	//range = 0.5, 1.1
}
  • name: Optional. Default '(anonymous)'. A name for the node.
  • texture: Required. The texture that will be used for the horizontal strip.
  • position: Required. The location on the monitor where the upper-left corner of the strip will be placed.
  • size: Required. The size of displayed portion of the strip.
  • input: Required. The variable that will be used to control the strip.
  • inputRange: Required. The range of values that will affect the position of the displayed strip. The result of 'input' is clamped to this range.
  • displayRange: Required. Controls how the 'inputRange' is mapped to texture locations. Lists the position in pixels for the lower and upper bound of the displayed image. For instance, in the above example, when heading is 0, the 0 pixel location is in the center of the strip. When the heading is 180, the 512 pixel is visible.
  • displayWidth: Required. The width of the visible portion of 'texture', in pixels as measured on the texture. Eg, if the texture is 512 pixels wide, and you want the 25% of it visible, you would use 'displayWidth = 128'.
  • wrap: Optional. Default false. When true, indicates that the texture is expected to wrap around (like a continuous ribbon). When false, the texture coordinates are clamped to the ends of the texture.
  • variable: Optional. When present, the variable will control whether this strip is rendered or not.
  • range: Optional. Ignored if 'variable' is not present. When present, the 'variable' operates in Threshold Mode; when absent, the 'variable' operates in Boolean Mode.

IMAGE

An Image node renders an image. The image's position and size may be specified, including resizing the image from its original.

The color options perform a component-by-component multiplication of the color in the texture with the color specified in the config. Using a white texture (RGB = 255, A varies for transparency) allows the reuse of a single texture for many different applications by applying color shifts. There are multiple ways of using the color shift options:

  • Use only passiveColor: Using a non-variable value for passiveColor allows tinting the texture. Each channel of passiveColor may also be a variable, allowing blended color shifts.
  • Use colorVariable: Allows many different ways to change colors. activeColor and passiveColor both may use variables for each channel, and colorVariable may be used in Boolean Mode, Threshold Mode, or Blend Mode.

When selecting the %MAP_ICON% special texture name to display stock map view icons, there are a few things to know:

  • tiling must be set to 0.2, 0.2 to display a single icon.
  • Icons may be selected using the fc.MapIconU(iconId) and fc.MapIconV(iconId) (see) fields for the uvShift setting. The iconId parameter of both of those functions can be automatically set by using fc.TargetTypeId() (see) for targets, or fc.VesselTypeId() (see) for the current vessel.
  • With the exception of the "EVA Kerbal" icon, all icons are uncolored, so passiveColor will need to be used to re-tint the icons.
  • The "Plane" icon and "Relay" icon are not part of the %MAP_ICON% atlas, so the "Ship" icon and "Probe" icon are used, instead.
IMAGE
{
	name = PFD overlay
	texture = JSI/RasterPropMonitor/Library/Components/NavBall/StaticMask
	//position = 128,256
	//size = 256,256
	//variable = fc.GetPersistentAsNumber("ShowImage")
	//range = 0.5, 1.1
	//rotation = fc.Roll()
	//rotationOffset = 64, 0
	//passiveColor = 255, 255, 255, 255
	//activeColor = COLOR_ASET_ACTIVE_COLOR
	//colorVariable = fc.GetThrottle()
	//colorRange = 0, 1
	//colorBlend = true
	//tiling = 1, 1
	//uvShift = 0, 0
//wrap = false
}
  • name: Optional. Default '(anonymous)'. A name for the node.
  • texture: Required. A URI to the texture that will be displayed. May also be the %FLAG% or %MAP_ICON% Keyword.
  • position: Optional. Default (0,0). The pixel offset from the upper-left corner of the page.
  • size: Optional. Defaults to the native size of the texture. Specifies the desired pixel width and height of the image.
  • variable: Optional. When present, the variable will control whether this image is rendered or not.
  • range: Optional. Ignored if 'variable' is not present. When present, the 'variable' operates in Threshold Mode; when absent, the 'variable' operates in Boolean Mode.
  • rotation: Optional. Applies a rotation to the image in degrees as provided by the variable. Rotation is anchored around the center of the image (unless moved with 'rotationOffset'), with a clockwise winding.
  • rotationOffset: Optional. Default (0, 0). Ignored when 'rotation' is not present. Moves the center of rotation from the middle of the image by the specified distance in pixels (+X is to the right, +Y is down, like other monitor coordinates).
  • passiveColor: Optional. Required if 'colorVariable' is present. Applies tinting to the image. Can be used without 'colorVariable' either to apply a constant color, or a variable color, as described above. May be a named color, constant values, or per-channel variables.
  • activeColor: Required if 'colorVariable' is present, ignored otherwise. Provides the active color when using 'colorVariable'. May be a named color, constant values, or per-channel variables.
  • colorVariable: Optional. Names a variable that is used to blend between 'activeColor' and 'passiveColor'.
  • colorRange: Optional. Ignored if 'colorVariable' is not present. When present, 'colorVariable' operates in Threshold Mode, or Blend Mode if 'colorBlend' is true.
  • colorBlend: Optional. Ignored if 'colorRange' is not present. When present, 'colorVariable' operates in Blend Mode.
  • tiling: Optional. Defaults to (1, 1). Controls the UV scaling of the image. A value of 2, for instance, indicates that the texture will repeat 2x along that axis. May be constant or variable.
  • uvShift: Optional. Default to (0, 0). Allows a UV shift to be applied to the texture. Shifts may be done along both axes, and either or both values may be a constant or a variable.
  • wrap: Optional. When present, overrides the UV wrap mode for the selected texture. By default, textures default to 'wrap' equal to 'true'. Caution: Because of the way textures are accessed, setting this value affects all places where the named texture is used. It is not possible to apply 'wrap = true' and 'wrap = false' to the same texture in different parts of the config files.

LINE_GRAPH

A Line Graph node is used to visualize numeric data using a line graph. The graph updates regularly, with the x-axis representing time (at one second per pixel) and the y-axis representing the data being tracked (with the value per pixel defined by the sourceRange and graph size).

Note that the width of the graph and the sample rate affect the memory and performance of this node: the node tracks a number of samples equal to the width divided by the sample rate, and once the graph is full, the older values are moved in memory. Many detailed graphs may cause some lag.

LINE_GRAPH
{
	name = Atmosphere Altitude
	position = 16, 16
	size = 480, 240
	source = fc.Altitude()
	sourceRange = 0, fc.AtmosphereTop()
	sourceColor = 0,160,182,255
	sampleRate = 1
	borderWidth = 2
	borderColor = 0, 80, 91,255
	//variable = fc.GetBrakes()
	//range = 0.5, 1.5
}
  • name: Optional. Default '(anonymous)'. A name for the node.
  • position: Required. The pixel offset from the upper-left corner of the page for this graph.
  • size: Required. Specifies the desired pixel width and height of the graph.
  • source: Required. The variable that will be graphed.
  • sourceRange: Required. The values for the bottom and top of the y-axis.
  • sourceColor: Required. The color of the line graph.
  • sampleRate: Required. How frequently the variable will be sampled. Values below 1 will be clamped to 1.
  • borderWidth: Optional. Required if 'borderColor' is present. The width in pixels for a border surrounding the graph area. This border is placed outside the region specified by 'position' and 'size'. In the above example, the border is 2 pixels wide, which means it is in x-position 14-16 and 496-498.
  • borderColor: Optional. Required if 'borderWidth' is present. The color of the graph's border.
  • variable: Optional. When present, the variable will control whether this graph is rendered or not.
  • range: Optional. Ignored if 'variable' is not present. When present, the 'variable' operates in Threshold Mode; when absent, the 'variable' operates in Boolean Mode.

LINE_STRING

A Line String nodes draws an arbitrary sequence of connected lines. It can be used to draw simple line segments using two vertices, or more complex shapes using multiple vertices. The line string is extremely configurable, allowing variables to alter the start color and line width, end color and line width, and vertex positions along the string.

Because this node generates a line string, it can be used to generate closed polygons (triangles, rectangles, etc.) by setting 'loop=true'.

Line strings may also use a texture to apply effects, such as a dotted line. The texture is applied with the U coordinate increasing between vertices, while the V coordinate increases across the width of the line. MAS adjusts the texture scale to attempt to keep the displayed texture at a 1:1 scale along the U direction (that is, if the texture is 32 pixels long, MAS will try to adjust the texture's scaling so it repeats every 32 pixels of line length).

There is no arbitrary limit to the number of vertices that can be included in a line string.

NOTE: KSP 1.3 uses Unity 5.4. The Unity 5.4 LineRenderer object that Line String uses has two bugs that affect the line quality. First, some segments of the line string have coordinates crossed so the line segment looks like a bowtie (it gets narrow in the middle). Second, the UV scaling is not perfect if the line segments have different lengths. It appears that the LineRenderer object divides the texture scaling across the segments of the line string, so the texture repeats the same amount in each segment. KSP 1.4 updated to Unity 2017.1, so these issues may have been fixed.

LINE_STRING
{
	name = Srf Prograde pitch line

	position = 256, 256
	//texture = path/to/texture

	startColor = 155, 255, 155, 255
	endColor = fc.GetThrottle() * 155, 255, 0, 255
		
	startWidth = 3.5
	//endWidth = 4.5

	//loop = false
		
	vertex = -62, fc.Remap(fc.PitchSurfacePrograde(), -8, 8, -62, 62)
	vertex = 62, fc.Remap(fc.PitchSurfacePrograde(), -8, 8, -62, 62)
	...
		
	//variable = 1
	//range = 0.5, 1.5

	//rotation = fc.GetRoll()
}
  • name: Optional. Default '(anonymous)'. A name for the node.
  • position: Required. The pixel offset from the upper-left corner of the page for the origin of the line string.
  • texture: Optional. A URI to a texture that will be applied to the line string.
  • startColor: Required. The color of the line string at the first vertex. The line will smoothly blend from this color to 'endColor'.
  • endColor: Optional. Defaults to 'startColor'. The color of the line string at the last vertex.
  • startWidth: Required. The width of the line string (in pixels) at the first vertex. The line will smoothly blend from this width to 'endWidth'.
  • endWidth: Optional. Defaults to 'startWidth'. The width of the line string (in pixels) at the last vertex.
  • loop: Optional. Defaults to false. When true, the Line String will automatically generate a line segment between the last vertex and the first vertex. This allows the config maker to avoid having to duplicate the first vertex as the last vertex.
  • vertex: Minimum of two required. More than two, optional. Provides the (x, y) offset from 'position' for each vertex in the line string.
  • variable: Optional. When present, the variable will control whether this line string is rendered or not.
  • range: Optional. Ignored if 'variable' is not present. When present, the 'variable' operates in Threshold Mode; when absent, the 'variable' operates in Boolean Mode.
  • rotation: Optional. When present, the 'rotation' variable will rotate all of the line strings around 'position'.

NAVBALL

A NavBall node is used to render a navball on the monitor. This can be used to create a primary flight display, or, with the right configuration, a 3D spherical HUD navigation aid.

Note that, at present, MAS does not include a NavBall model and texture. The example below assumes that RPM is installed. The ASET Props pack also includes a navball model.

NAVBALL
{
	name = PFD navball
	model = JSI/RasterPropMonitor/Library/Components/NavBall/NavBall
	texture = JSI/RasterPropMonitor/Library/Components/NavBall/NavBall000
	//position = 256, 256
	size = 340, 340
	//opacity = 0.9
	//variable = fc.GetBrakes()
	//range = 0.5, 1.5
}
  • name: Optional. Default '(anonymous)'. A name for the node.
  • model: Required. The URI to the navball model. While this is typically a simple sphere, there is no requirement to use a ball for this component.
  • texture: Required. The texture that is applied to the navball model.
  • position: Optional. Default the middle of the screen. A displacement to move the navball on the screen. The 'position' is the center of the navball.
  • size: Required. Specifies the pixel width and height of the image. Note that the navball is rendered to a square, so using a non-square size here will distort the shape of the navball.
  • opacity: Optional. Defaults to 1.0. Controls the alpha value of the navball. Setting this value less than one will make the navball partially transparent.
  • variable: Optional. When present, the variable will control whether the navball is rendered or not.
  • range: Optional. Ignored if 'variable' is not present. When present, the 'variable' operates in Threshold Mode; when absent, the 'variable' operates in Boolean Mode.

ORBIT_DISPLAY

Still under development, details may change

The Orbit Display node behaves similarly to the JSIOrbitDisplay in RasterPropMonitor. It is used to draw ellipses representing the current vessel's orbit, the orbit of its target, the resulting orbit of any planned maneuver node, and a representation of the body the vessel currently orbits. The MAS Orbit Display is more advanced than the RPM module, and it contains more configuration options as well.

ORBIT_DISPLAY
{
  name = Orbital Schematic

  position = 0, 432
  size = 1024, 512

  vertexCount = 32
  orbitWidth = 3
  bodyWidth = 5

  vesselStartColor = COLOR_XKCD_KSPUNNAMEDCYAN
  vesselEndColor = 95, 189, 185, 127 // KSPUNNAMEDCYAN with 50% alpha

  targetStartColor = 255, 0, 255, 255
  targetEndColor = 255, 0, 255, 127

  maneuverStartColor = COLOR_XKCD_KSPNOTSOGOODORANGE
  maneuverEndColor = 255, 176, 0, 127 // 50% alpha for COLOR_XKCD_KSPNOTSOGOODORANGE

  //bodyColor = 255, 255, 255, 255
  //atmoColor = 255, 255, 255, 255

  //variable = MyEnableThis()
  //range = 0.5, 1.5
}
  • name: Optional. Default '(anonymous)'. A name for the node.
  • position: Optional. Default (0, 0). The upper left corner of the location where the orbits will display.
  • size: Required. Specifies the pixel width and height of the region used to display the orbits. Since the Orbit Display uses a render texture, best results will be given if the width and height are powers of 2 (although they may be different).
  • vertexCount: Required, must be at least 3. The number of vertices used to draw the orbit ellipses and planetary bodies. The larger the value, the smoother the curves, but the more computations required to update everything.
  • orbitWidth: Optional, default 1. The width of the lines used to draw orbits, in pixels.
  • bodyWidth: Optional, default 1. The width of the lines used to draw the current body and its atmosphere, in pixels.
  • vesselStartColor: Optional, default white. The color of the line used to represent the beginning of the current vessel's orbit.
  • vesselEndColor: Optional, default vesselStartColor. The color used to represent the end of the current vessel's orbit. If the vesselEndColor is omitted, the orbit is drawn in one color. Otherwise, the orbit fades from vesselStartColor at the vessel's current location to vesselEndColor at the end of one orbit (or the end of the current orbital patch).
  • targetStartColor, targetEndColor: Optional, default white and targetStartColor, respectively. Behaves the same as the vessel start and end color, but applies to target orbit paths.
  • maneuverStartColor, maneuverEndColor: Optional, default white and maneuverStartColor, respectively. Behaves the same as the vessel start and end color, but applies to post-maneuver orbit paths.
  • bodyColor: Optional, default automatic color. When present, this color is always used to render the body that the vessel currently orbits. When it is omitted, MAS automatically selects a color based on the body currently being orbited.
  • atmoColor: Optional, default automatic color. When present, this color is always used to render the edge of the atmosphere (when present) of the body the vessel currently orbits. When it is omitted, MAS selects a color based on the atmosphere's ambient color.
  • variable: Optional. When present, the variable will control whether the orbit schematic is rendered or not.
  • range: Optional. Ignored if 'variable' is not present. When present, the 'variable' operates in Threshold Mode; when absent, the 'variable' operates in Boolean Mode.

POLYGON

A Polygon node provides a way to make arbitrary two-dimensional filled primitives (triangles, squares, or more complex shapes). There are some caveats to using these polygons:

  1. Vertex order matters. MAS must slice the polygon into a series of triangles, and if the vertices are wound the wrong way, they are not visible. Polygon vertices must be specified with a counter-clockwise ordering as viewed on the MFD display. Remember that MASMonitor uses a left-handed coordinate system (the top-left corner is 0, 0). If your polygon is not visible when it should be, you most likely wound the polygon the wrong way.
  2. Polygons are solid-filled only. They do not support multiple (or per-vertex) colors, and they do not support texturing.
  3. Polygons that have "bowties" where the vertices cross over may or may not render correctly.

The first two restrictions may be relaxed in future updates. The third restriction is a side-effect of the algorithm used to slice the polygon into triangles.

POLYGON
{
  name = poly
  position = 64, 96
  color = 0, 255, 255, 255

  rotation = -90 * fc.GetThrottle()

  vertex = 0, 32
  vertex = 64, 32
  vertex = 128 + 32 * fc.GetThrottle(), 0
  vertex = 64, -32
  vertex = 0, -32

  //variable = MyEnableThis()
  //range = 0.5, 1.5
}
  • name: Optional. Default '(anonymous)'. A name for the node.
  • position: Required. The screen position for the origin of the polygon's coordinates.
  • color: Required. Defines the color of the polygon.
  • rotation: Optional. Default 0. The variable that controls the rotation of the polygon. The polygon is rotated around the origin as defined by 'position'.
  • vertex: Required, minimum 3. The vertices of the polygon. Each vertex position may be a constant or a numeric variable.
  • variable: Optional. When present, the variable will control if the polygon is rendered.
  • range: Optional. Ignored if 'variable' is not present. When present, the 'variable' operates in Threshold Mode; when absent, the 'variable' operates in Boolean Mode.

RPM_MODULE

The RPM Module node provides a way to interact with legacy RasterPropMonitor mod bridge components. In RPM, a mod can provide a number of methods in a module, and RPM would call those methods to render images or text on one of its own monitors.

MAS is able to reproduce that behavior, although the prop config maker will need to take some additional steps, since MAS does not include RPM's 'magic' module instantiation code.

Prop Configuration

The first important difference is that the config maker must include the internal modules that the monitor uses in the prop's configuration. MAS will not magically add those modules at run time. If the module is not already present in the prop, that module will be treated as non-functional.

To add the module configuration, simply copy the BACKGROUNDHANDLER OR PAGEHANDLER from an RPM config, change the node name to MODULE, and add it to the prop. Note that some mods, such as DPAI, have both BACKGROUNDHANDLER and PAGEHANDLER nodes. Include only the one that has most of the data. You do not need to include two MODULEs.

One way to add the modules is to use a Module Manager config, such as:

@PROP[MAS_ALCOR_MFD1]:NEEDS[SCANsat]
{
	MODULE
	{
		name = JSISCANsatRPM
		buttonUp = 0
		buttonDown = 1
		buttonEnter = 2
		buttonEsc = 3
		buttonHome = 4
		buttonRight = 5
		buttonLeft = 6
		buttonR9 = 7
		buttonR10 = 8
		mapDivider = 2
		resourceInterpolation = 4
		zoomModifier = 2.0
		iconPixelSize = 16
		iconShadowShift = 2,2
		scaleBarPosition = 16,144
		scaleBar = JSI/RasterPropMonitor/Library/Textures/scalebar
		scaleLabels = JSI/RasterPropMonitor/Library/Textures/scaleLabels
	}
}

The numbers used for the button events, such as buttonUp, buttonDown, etc, in the above example, correspond to softkey events passed to the monitor.

Note that you do not need to include any of the 'method' fields in this node. Those are added to RPM_MODULE.

RPM_MODULE Configuration

Add an RPM_MODULE node to your page, as seen below. If there was a 'pageActiveMethod' or 'buttonClickMethod' in the RPM handler node, copy those to the RPM_MODULE.

If the source node was a BACKGROUNDHANDLER, copy the 'method' field to 'renderMethod' in RPM_MODULE. If the source node was a PAGEHANDLER, you will need to use its 'method' field in a TEXT node (see TEXT).

The 'renderSize' field applies only if there is a 'renderMethod'. If the mod does not have a 'renderMethod', the following information does not apply.

The 'renderSize' field is used because some mods assumed MFDs were always 640x640, since the RPM example MFDs used those dimensions. If those mods render to a texture with different dimensions, the result will be incomplete.

If 'renderSize' is omitted, and the RPM module does not appear to render correctly, add 'renderSize = 640, 640' to the RPM_MODULE configuration and see if the module renders correctly.

Module Fields

RPM_MODULE
{
	name = Legacy SCANsat display

	moduleName = JSISCANsatRPM

	renderMethod = MapRenderer
	buttonClickMethod = ButtonProcessor
	pageActiveMethod = PageActive

	//renderSize = 640, 640

	texture = ASET/ASET_Props/MFDs/ScreenPlates/noscansat

	position = 0, 0
	size = 512, 512
}
  • name: Optional. Default '(anonymous)'. A name for the node.
  • moduleName: Required. The name of the RPM bridge module. In an RPM config, this would be the 'name' for the BACKGROUNDHANDLER node or PAGEHANDLER node.
  • renderMethod: Optional. Most RPM bridge modules use a BACKGROUNDHANDLER to draw graphics for display on the MFD. The 'renderMethod' is the 'method' field from the corresponding BACKGROUNDHANDLER node.
  • buttonClickMethod: Optional. The 'buttonClickMethod' is used to notify the bridge mod of relevant button clicks. This field should be copied directly from the BACKGROUNDHANDLER node or PAGEHANDLER node.
  • pageActiveMethod: Optional. The 'pageActiveMethod' is used to notify the bridge mod when it is being displayed and needs to update itself, or when it is no longer being displayed. This field should be copied directly from the BACKGROUNDHANDLER node or PAGEHANDLER node.
  • texture: Optional. A URI to the texture that will be displayed if the module listed in 'moduleName' is not found. If 'texture' is not provided and the module is not found, the rendered area will be black.
  • position: Optional. Default (0,0). The pixel offset from the upper-left corner of the page.
  • size: Optional. Defaults to the configured size of the monitor. Specifies the desired pixel width and height of the displayed image or text.
  • renderSize: Optional. Defaults to 'size'. This is the size of the render texture that the 'renderMethod' will use. Please read the notes above to understand when and why you would use this field.
  • variable: Optional. When present, the variable will control whether this text is rendered or not.
  • range: Optional. Ignored if 'variable' is not present. When present, the 'variable' operates in Threshold Mode; when absent, the 'variable' operates in Boolean Mode.

TEXT

A Text node renders text. This text may be static (unchanging) data, or it may use variables. Simple text can be defined in the Text node using a 'text' field, while complex or multi-line text residing in a separate file may referenced with a 'textfile' field. All text supports Formatted Rich Text.

The Text node may also render text from a RasterPropModule bridge mod, such as the text overlay seen in the DPAI mode. For this configuration, the bridge mod needs to be configured as described in RPM_MODULE, and the 'method' field needs to be included in a 'textmethod' entry in the Text node.

These text nodes are not as complex as a Text Label - there are no controls for alignment, font size, anchors, etc. However, they still support Formatted Rich Text.

TEXT
{
  name = Important Text Node
  text = Hello, world!
  //textfile = MOARdV/AvionicsSystems/Sample/helloworld.txt
  //textmethod = DPAI_RPM:getPageText
  //font = InconsolataGo
  //style = Bold
  //fontSize = 16, 32
  //textColor = 0, 255, 0, 255
  //position = 0,0
  //variable = fc.GetRCS()
  //range = 0.5, 1.5
}
  • name: Optional. Default '(anonymous)'. A name for the node.
  • text: Required if there is not a 'textfile' or a 'textmethod' entry. Text that is displayed for this node, similar to a Text Label action in MASComponent.
  • textfile: Required if there is not a 'text' entry or a 'textmethod' entry; ignored if there is a 'text' field. Refers to a text file that contains the text that will be rendered.
  • textmethod: Required if there is not a 'text' entry or a 'textfile' entry; ignored if either of those entries are present. Refers to an RPM bridge plugin that can display text on the monitor. The 'textmethod' is formatted by applying the 'name' field from the RPM PAGEHANDLER node, followed be a ':', followed by the 'method' from the PAGEHANDLER, such as textmethod = DPAI_RPM:getPageText. The 'textfile' is usually the better choice for multi-line text.
  • font: Optional. The name of the font to use for rendering this text. If this parameter is omitted, the font listed in the MASMonitor config section is used.
  • style: Optional. Default 'Normal'. The style of font to use, if available. Valid options are Normal (the default), Bold, Italic, and BoldAndItalic. Note that the use of Formatted Rich Text tags that change the style will override the style field.
  • fontSize: Optional. The width and height of this text as rendered on the screen, in pixels. If it is omitted, the default from MASMonitor is used.
  • textColor: Optional. The default text color for this text. If the entry is omitted, the default found in MASMonitor is used.
  • position: Optional. Default (0, 0). An offset from the upper-left corner for the text being rendered. The offset is in units of character columns and rows, not pixels. The row and column size is based on the 'fontSize' of the MASMonitor, not the optional 'fontSize' specified in the TEXT node.
  • variable: Optional. When present, the variable will control whether this text is rendered or not.
  • range: Optional. Ignored if 'variable' is not present. When present, the 'variable' operates in Threshold Mode; when absent, the 'variable' operates in Boolean Mode.

VERTICAL_BAR

A Vertical Bar node renders a bar graph that grows or shrinks vertically in response to the source variable. The bar graph may be a solid color, or it may use a texture, as described in the Horizontal Bar entry.

VERTICAL_BAR
{
	name = VSI
	position = 256, 272
	size = 32, 128
	source = fc.PseudoLog10(fc.VerticalSpeed())
	sourceRange = -5, 5
	sourceColor = 64,192,64,255
	anchor = Middle
	//texture = AvionicsSystems/Textures/horiz_bargraph
	borderWidth = 2.5
	borderColor = 64, 255, 64,255
	//variable = fc.GetBrakes()
	//range = 0.5, 1.1
}
  • name: Optional. Default '(anonymous)'. A name for the node.
  • position: Required. The location on the monitor where the upper-left corner of the bar graph will be placed.
  • size: Required. The size of the graph.
  • source: Required. The variable that will be graphed.
  • sourceRange: Required. The values for the bottom and top ends of the bar.
  • sourceColor: Optional. Defaults to white. The color of the bar graph.
  • texture: Optional. When present, the named texture is drawn so it will fill the graph's area. Color textures may be used - the sourceColor is multiplied by the texture color in that case. If no texture is provided, the graph is treated as a solid color.
  • anchor: Optional. Defaults to 'Bottom'. Defines the anchor of the bar graph. 'Bottom' means the bottom side of the region, in which case the graph grows towards the top. 'Top' means the opposite: the graph starts on the top and it grows to the bottom. 'Middle' mwans the graph starts in the center, and it grows to the bottom if the source value is below 1/2 of the range, or it grows to the top if the source value is above 1/2 of the range.
  • borderWidth: Optional. Required if 'borderColor' is present. The width in pixels for a border surrounding the graph area. This border is placed outside the region specified by 'position' and 'size'.
  • borderColor: Optional. Required if 'borderWidth' is present. The color of the graph's border.
  • variable: Optional. When present, the variable will control whether this strip is rendered or not.
  • range: Optional. Ignored if 'variable' is not present. When present, the 'variable' operates in Threshold Mode; when absent, the 'variable' operates in Boolean Mode.

VERTICAL_STRIP

A Vertical Strip node renders part of a texture in response to a variable input. It can be used for a aircraft VSI and altitude strips on a HUD or other applications. The full width of the source texture is always displayed in a vertical strip, but only a portion of the height is visible at any given time.

VERTICAL_STRIP
{
	name = VSI
	texture = JSI/RasterPropMonitor/Library/Components/HUD/leftscale
	position = 86,64
	size = 64,320
	input = fc.PseudoLog10(fc.VerticalSpeed())
	inputRange = -5, 5
	displayRange = 1845,208
	displayWidth = 640
	//wrap = false
	//variable = fc.GetBrakes()
	//range = 0.5, 1.1
}
  • name: Optional. Default '(anonymous)'. A name for the node.
  • texture: Required. The texture that will be used for the horizontal strip.
  • position: Required. The location on the monitor where the upper-left corner of the strip will be placed.
  • size: Required. The size of displayed portion of the strip.
  • input: Required. The variable that will be used to control the strip.
  • inputRange: Required. The range of values that will affect the position of the displayed strip. The result of 'input' is clamped to this range.
  • displayRange: Required. Controls how the 'inputRange' is mapped to texture locations. Lists the position in pixels for the lower and upper bound of the displayed image. Pixels count up from the top of the image (the top of the image is '0', the bottom is whatever the height of the image is).
  • displayHeight: Required. The height of the visible portion of 'texture', in pixels as measured on the texture. Eg, if the texture is 512 pixels tall, and you want the 25% of it visible, you would use 'displayHeight = 128'.
  • wrap: Optional. Default false. When true, indicates that the texture is expected to wrap around (like a continuous ribbon). When false, the texture coordinates are clamped to the ends of the texture.
  • variable: Optional. When present, the variable will control whether this strip is rendered or not.
  • range: Optional. Ignored if 'variable' is not present. When present, the 'variable' operates in Threshold Mode; when absent, the 'variable' operates in Boolean Mode.

VIEWPORT

A Viewport node allows the IVA designer to mask out parts of the data displayed below it. Primary uses are for masking complex lines or graphics that are supposed to be constrained within a certain portion of the screen.

The viewport is a rectangle defined by of two corners, the upper-left and lower-right. Anything that is listed earlier than the viewport in the page definition will be obstructed by the viewport, unless it falls inside the bounds of the viewport's rectangle.

VIEWPORT
{
	name = Test Viewport
		
	upperLeftCorner = 128, 128
	lowerRightCorner = 384, 256 + 256 * fc.GetThrottle()
		
	color = 128, 128, 0, 255
		
	//variable =
	//range =
}
  • name: Optional. Default '(anonymous)'. A name for the node.
  • upperLeftCorner: Required. Describes the upper-left corner of the viewport. Note that either or both parameter may be a variable.
  • lowerRightCorner: Required. Describes the lower-right corner of the viewport. Note that either or both parameter may be a variable.
  • color: Optional. Defaults to (0, 0, 0, 255). The color of the viewport mask. Any channel may be a variable.
  • variable: Optional. When present, the variable will control whether or not the viewport is enabled.
  • range: Optional. Ignored if 'variable' is not present. When present, the 'variable' operates in Threshold Mode; when absent, the 'variable' operates in Boolean Mode.
Clone this wiki locally