Rect2D
- Last UpdatedFeb 19, 2025
- 4 minute read
The Rect2D node inherits from RectBase2D. It provides all the functionalities needed by a pushbutton.

Platform support
This node is fully supported on XR-Windows platform.
It is partially supported on XR-Portable Windows, XR-Portable iOS, XR-Portable Android, and XR-P WASM platforms.
The portable versions do not support image display for other nodes.
|
XR-WIN |
XR-P-WIN |
XR-P-IOS |
XR-P-AND |
XR-P-WASM |
|---|---|---|---|---|
|
Full support |
Partial support |
Partial support |
Partial support |
Partial support |
|
|
|
|
|
|
Connecting to Image generator nodes
Rect2D can be used to show an image generated by another node. For example, plugin nodes can use this approach to be displayed.
To host the visual outcome of a node that generates images, the images field must contain a single entry and must be set like this:
images="node:BrowserClientNodeName"
It's always possible to switch between node, images, and colors at runtime.
Gallery showreel functionalities
When the images field is provided by a list of images, you can set up an automatic image loop.
|
Parameter |
Description |
|---|---|
|
cycleSpeed |
Defines the interval in seconds before to switch the shown image. |
|
cycleEnabled |
Plays the photo roll. |
Playing an animated gif
For Rect2D to display an animated GIF, the images field must contain only the .gif file.
|
Parameter |
Description |
|---|---|
|
cycleEnabled |
Starts the animation. |
|
cycleSpeed |
Increases GIF speed. |
Code example
This is a code example for the Rect2D node.
<Rect2D name="rect" templateInfo="Rect2D|rect" position="90 231" size="300 300" visible="true" images="nice.gif"/>
Image color filter modes
The following options define the strategy to use when applying a color filter to an image:
-
none—The selected color is not applied to the images.
-
screen—The selected color is added to the image. This makes the image brighter and has more effect on dark colors. Black color is colored, light colors will tend to white, and white color stays white (since it is already the lightest color possible). This mode is suited to color black or dark glyphs by a selected color.
-
multiply—The image colors are multiplied by the selected color. This makes the images darker and has more effect on light colors. White color is colored, dark colors will tend to black, and black color stays black (since it is already the darkest color possible). This mode is suited to color white or light glyphs by a selected color.
-
overlay—Applies both screen and multiply strategies to the image by the selected color. This keeps the image brightness almost the same, has a balanced influence on light and dark colors, and allows to color both black and white.
-
invert—Inverts the color of the displayed image. The selected color is not used in this mode.

Rect2D fields
These are the fields for Rect2D node. Only the node-specific fields are indicated, not fields obtained by inheritance.
Field inheritance: NodeBase > RectBase2D > Rect2D
|
Fields |
Type |
Use |
Default value |
Description |
|---|---|---|---|---|
|
color |
svec3 |
Optional |
1 1 1 |
If no image is set, use this parameter to define RGB rect color. |
|
cycleEnabled |
sbool |
Optional |
false |
Enables image show reel or GIF animation. |
|
cycleSpeed |
sfloat |
Optional |
1 |
Speed, expressed in images per second, for image switch during show reel or GIF animation multiplier. |
|
images |
mstring |
Optional |
A comma-separated list of image files that can contain one or more images, an animated gif, or a reference to a node that supports image generation. When using a node reference, the list must contain the reference only with the syntax node:nodeName. When the list is empty, the Rect2D is filled with color. |
|
|
imageColorFilter |
svec4 |
Optional |
0, 175, 239 |
A solid color that is blended on the displayed imageDown, supports alpha channel. For more information about different blend strategies, see Image color filter modes. |
|
imageColorFilterMode |
senum |
Optional |
none |
Defines the strategy used to blend the color selected in imageColorFilter on the displayed imageDown. The following options are available: none, screen, multiply, color, invert. See Image color filter modes section for details. |
|
imageIndex |
sint |
Optional |
0 |
The currently displayed imageIndex. Used to change the display content or can be read in case of gallery show reel. |