Documentation / Node reference / tex nodes
tex/Transform
Moves, scales and turns the image on its input inside its own frame, and can tile it.
Transform
The result keeps the size of the image on the input. Inside that frame, translate moves the image, scale makes it bigger or smaller, and rotation turns it. borderMode says what fills the parts of the frame the image no longer covers.
The pivot is the point that scale and rotation keep still, from 0 to 1 across the image from its top left corner: the default 0.5, 0.5 is the centre, so the image grows and turns around its middle; 0, 0 makes it grow from its top left corner. translate is measured in parts of the image: 0.5, 0 moves it half its width to the right, 0, 0.5 half its height down. A negative scale flips the image on that axis: -1, 1 mirrors it left to right.
borderMode: TRANSPARENT leaves empty space around the image, to place a picture inside a larger blank area. CLAMP stretches the image's edge pixels outwards. REPEAT tiles the image, the way a texture repeats on a floor: scale 0.25, 0.25 shows it four times across and four times down. MIRROR tiles it too, but flips every other copy, so the edges of two copies match and no seam shows.
filter: BILINEAR blends the four nearest pixels, for smooth photos and drawings. NEAREST keeps hard square pixels, for pixel art. Shrinking an image a lot with BILINEAR makes it grainy: put a tex/Resize with the AREA filter before this node to shrink it first.
To transform only one area of a picture, layer the result over the original with tex/Layer and a mask. To place a picture over ANOTHER picture, use tex/Layer itself, which has the same position, scale and rotation. It runs on the GPU when there is one, and any tex node can feed it.
Parameters
| Name | Type | What it does |
|---|---|---|
| translate | Vector2 | Moves the image, in parts of its own size: 0.5, 0 moves it half its width to the right, 0, -0.5 half its height up. |
| pivot | Vector2 | The point that scale and rotation keep still, from 0 to 1 across the image from its top left corner. 0.5, 0.5 is the centre; 0, 0 the top left corner. |
| scale | Vector2 | The size of the image, across and down. 1, 1 keeps it as it is, 0.5, 0.5 halves it, 2, 1 stretches it to twice its width. A negative value flips the image on that axis: -1, 1 mirrors it left to right. With borderMode REPEAT, 0.25, 0.25 tiles it four times each way. |
| rotation | Float | Turns the image around the pivot, in degrees, counter-clockwise. |
| borderMode | UInt8 CLAMP · TRANSPARENT · REPEAT · MIRROR | What fills the frame where the image no longer reaches. TRANSPARENT: nothing, so the image sits in empty space. CLAMP: the edge pixels stretch outwards. REPEAT: the image tiles, for a repeating texture. MIRROR: the image tiles with every other copy flipped, so the copies meet without a seam. |
| filter | UInt8 BILINEAR · NEAREST | How new pixels are read from the image. BILINEAR blends the four nearest pixels, for smooth results. NEAREST copies one pixel, for crisp pixel art. |
Examples
Scenes you can open in the editor that teach this node.
See also
This page is generated from the engine, so it describes the release you can download. The same text is in the editor's Help panel next to the node itself.