Skip to main content

mapper.viewport()

mapper.viewport(param_table)

This funciton registers a new Viewport.
The viewports registered with this function are inactive until mapper.start_viewports() is called. Inactive viewports are not only hidden from the screen but also do not activate associated Event-Action mappings with the viewport in a paused state.

Parameters

ParameterTypeDescription
param_tabletableThis parameter is in associative array table format, meaning it's specified by keys rather than parameter positions. See the Parameters Table section.

Parameters Table

KeyTypeDescription
namestringUser-assigned name for the Viewport object.
This parameter is required.
displaynonumberSpecifies the display number for placing the viewport.
If this parameter is omitted, the position and size of the viewport are specified in absolute coordinates relative to the entire screen space, and x, y, width, and height must be specified.
coordinatestringCordinate system type.
If relative is specified, the display space is treated in a relative coordinate system. This means that the values specified for x, y, width, and height are interpreted as relative to the width and height of the display.
If absolute is specified, the display space is treated in an absolute coordinate system. This means that the values specified for x, y, width, and height are interpreted as pixel values.
The default is relative, but it becomes absolute if displayno is omitted.
xnumberX-coordinate of the top-left corner of the viewport.
The default is 0.
ynumberY-coordinate of the top-left corner of the viewport.
The default is 0.
widthnumberWidth of the viewport.
The default is the width of the display.
heightnumberHeight of the viewport.
The default is the width of the display.
logical_widthnumberSpecifies the logical width of the viewport's active area.
It determines the aspect ratio of the viewort's active area, along with logical_height, and sets the unit length in the logical coordinate system. If this parameter is specified, the default coordinate system for the viewport and the coordinate system inherited by the view will be absolute coordinate system.
This parameter and aspect_ratio are mutually exclusive.
logical_heightnumberSpecifies the logical height of the viewport's active area. Refer to the description for lgical_width.
aspect_rationumberSpecifies the aspect ratio of the viewport's active area.
If this parameter is specified, the default coordinate system for the viewport and the coordinate system inherited by the view will be relative coordinate system.
This parameter and the pair of logical_width and logical_height are mutually exclusive.
horizontal_alignmentstringSpecifies how to align the viewport's active area horizontally when the aspect ratio of the viewport and the aspect ratio of the active area differ. It specifies either of center, left, or right.
The default is center.
vertical_alignmentstringSpecifies how to align the viewport's active area vertically when the aspect ratio of the viewport and the aspect ratio of the active area differ. It specifies either of center, top, or bottom.
The default is center.
bgcolorColor, stringBackground color of the viewport. In case the aspect ratio of the viewport differs from the aspect ratio of the viewport's active region, this parameter specifies the color to fill both gaps with.
Both a Color object and a string-formatted color name, which can be specified when creating a Color object, can be used for this parameter.
The default color is black.
ignore_transparent_touchesbooleanIf this parameter is set to true, touch and mouse operation messages in transparent areas of the view will not be passed to windows behind it. In other words, it prevents interaction with background windows via touch or mouse. For instance, if you are using a touch-based instrument like the Garmin G3X Touch as a CapturedWindow view element within the view, you should not set this parameter to true.
Setting this parameter to true will prevent interaction with windows behind the viewport but can improve viewport display efficiency on the monitor. By default, the viewport is shown as a Layered Window, however, with this parameter set to true, it utilizes DirectComposition for rendering. Even if GPU rendering is specified for Rendering Method on the Settings page to construct the view image in GPU memory, using a Layered Window requires GPU-to-CPU data transfers per window update due to hit-testing in the transparent area. DirectComposition avoids this memory copying, thus enhancing performance.
The default is false.

Return Values

This function returns Viewport object.

See Also