The Coordinate Container makes a component's size and location relative to its parent's size and location. Components can be fixed size, or optionally grow/shrink proportionally when the view is stretched.
Coordinate Containers are ideal to use in cases where you need components to overlap each other, such as adding a component on top of another (z-axis) to act as an overlay. They're also useful in cases where you do not want components within to resize - for example, building a diagram where each element is a separate component.
Components placed in coordinate containers can be rotated. The Rotate property has been moved to the Position Properties section of the Perspective Property Editor. For more information, see Working with Perspective Components.
The Coordinate Container component has two pre-configured variants:
- Fixed - Child layouts will be in fixed coordinate space.
- Percent - Child layout will be stretched to different size containers.
Whether child layouts should always be in fixed coordinate space, or stretched relative to different container sizes: fixed or percent.
Fixed mode uses absolute units, which reduces the amount of resizing of components within the container when launched across different display sizes. Percent mode uses relative units, which means child components will be able to resize appropriately when launched on different sized displays.
|aspectRatio||Only applied in percent mode. Optional dimensions, in x:y format to apply to maintain container aspect ratio for different sizes. Empty string (or non x:y input) will disable this mode.||value: string|
|style||Sets a style for this component. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class .||object|
Child Component Position Properties
When a component is placed inside of a coordinate container, it will inherit the position properties listed below.
Note that the values for x, y, width, and height will differ based on the mode of the coordinate container.
- fixed: Values represent absolute lengths. Example, an x value of 100px means the left edge of the component starts 100 pixels from the left edge of the container.
- percent: Values are in relative lengths. Example, say a component has an x value of 0.25. In this scenario, the left edge of the container would be 0, the right edge would be 1. So 0.25 would be 25% distance from the left edge of the container.
|x||Specifies the horizontal positioning of the component in pixels.||value: numeric|
|y||Specifies the vertical positioning of the component in pixels.||value: numeric|
|width||Specifies the width of the component in pixels.||value: numeric|
|height||Specifies the height of the component in pixels.||value: numeric|
Setting that sets the anchor and angle of rotation for the component.
The Perspective Event Types Reference page describes all the possible component event types for Perspective components. Not all component events support each Perspective component. The Component Events and Actions page shows how to configure events and actions on a Perspective component. Component scripting is handled separately and can be accessed from the Component menubar or by right clicking on the component.
This event will trigger when a pipe in this container is clicked.
This component event is designed to be used in tandem with a script runAction. Within the script action, special properties and methods are available on the event object, which is passed to the script action as a parameter.
- Object Path
The event object generated from the mouse click.
- Object Path
Integer or float
The array index of the pipe within props.pipes that was clicked.
- Object Path
The name of the pipe that was clicked.
Returns an ArrayList, which contains references to all components inside of the container.
Array List - An ArrayList of components in the container. The resulting ArrayList can be iterated over via a for-loop.
In this example, we have a Coordinate container with a Cylindrical Tank component and a Slider component. We've set the container property to percent so that the components will grow and shrink with the container size.
Cylindrical Tank properties: