Image2D
Put any picture over your scene, like a logo, a HUD or a render from another camera. Move it, scale it, blend it and give it shadows and outlines.


After: An Image2D of the fish picture with Display Size 300 by 266 pixels.
An Image2D is an ImageContent that draws itself over its DataModel's picture. Size is its pixels, and DisplaySize is how big it's drawn at Position. Give it a file, render into it or DrawOnto it. It is drawn after the 3D image, so moving it never restarts a path trace. Layer styles under it draw with it. As in Roblox, ImageRectOffset and ImageRectSize crop it and ScaleType slices, tiles, fits or crops it; RobloxClass keeps its ImageLabel or ImageButton class.
Example
-- Studio is the scene a new project starts with
local studio = Root.Studio
local cam = studio.CurrentCamera
local view = Instance.new("Image2D", studio)
view.Position = Vector2.new(800, 40)
cam:RenderTo(view)Properties
Interaction
| Name | Type | Default |
|---|---|---|
| AutoButtonColor | boolean | |
| Modal | boolean | |
| Selected | boolean |
Layout
| DisplaySize | Vector2 | 200, 200 | How big it is drawn on screen and where DrawOnto places it as a source; Size is its pixel size. |
Image
| HoverImage | string | ||
| ImageRectOffset | Vector2 | 0, 0 | With ImageRectSize, crops the image as Roblox does, before any ScaleType draw. |
| ImageRectSize | Vector2 | 0, 0 | With ImageRectOffset, crops the image as Roblox does, before any ScaleType draw. |
| PressedImage | string | ||
| SamplingMode | string | Linear Linear, Nearest | Nearest draws it with nearest-pixel filtering for this draw only; the texture's own filtering elsewhere is untouched. |
| ScaleType | string | Stretch Stretch, Slice, Tile, Fit, Crop | Stretch, Slice, Tile, Fit or Crop, drawn as Roblox does: Slice's nine pieces, Tile's repeat, Fit's bars or Crop's cut. |
| SliceCenterMax | Vector2 | 0, 0 | |
| SliceCenterMin | Vector2 | 0, 0 | |
| SliceScale | number | 1 0 to 1000 | Slice's corners are drawn at their pixels times SliceScale, all shrunk alike when the box is too small. |
| TileSizeOffset | Vector2 | 0, 0 | |
| TileSizeScale | Vector2 | 1, 1 |
Scripts
| ImageColor3 | Color3 | scripts only | Roblox's name for Color, which Luau takes as an alias. |
| ImageTransparency | number | scripts only | Roblox's name for Transparency, which Luau takes as an alias. |
| ResampleMode | string | scripts only | Roblox's name for the sampling: Pixelated is SamplingMode Nearest. |
Roblox
| RobloxClass | string | "" ImageLabel, ImageButton | The class it came as, ImageLabel or ImageButton, which Ctrl+C writes back; one made in Stroke goes as an ImageLabel. |
