Base2D
Lay 2D over your 3D. Place pictures, text and panels in pixels, then scale, tint, blend and animate them in and out without setting a single key.
Base2D is the abstract base of every 2D thing. That's Image2D, Text2D, Frame2D and the video layers. It is a rectangle in pixels from the top-left of the image, or of the 2D item it sits in, so it moves with that item. Its AnchorPoint sits at Position, and it is drawn Size times Scale around that point. Color tints, Transparency fades and BlendMode picks one of 35 blend modes. InAnimation and OutAnimation play as it comes and goes.
Properties
Scripts
| Name | Type | Default | Description |
|---|---|---|---|
| AbsolutePosition | Vector2 | scripts only | The top-left of its drawn box on the canvas; read-only. |
Layout
| AnchorPoint | Vector2 | 0, 0 | The point that sits at Position; it is drawn and scaled around this point. |
| Position | Vector2 | 40, 40 | In pixels from the top-left of the DataModel's image, or inside an Image2D, Text2D or Frame2D from the top-left of that parent's drawn box. |
| Scale | Vector2 | 1, 1 | Grows or shrinks it in place, text and strokes too; a negative Scale mirrors pictures. |
| Visible | boolean | true | Hides it when set to false. |
| ZIndex | number | 1 any value | Higher draws on top; ties are stacked in tree order. |
Animation
| AnimationEasing | string | Smooth Smooth, Linear, Back | |
| AnimationEnd | number | -1 any value | |
| AnimationStart | number | 0 any value | |
| InAnimation | string | None None, Fade, Slide, Pop, Typewriter, Wipe | The animation it comes in with, applied when drawn, so keys and scripts are untouched. |
| InDuration | number | 0.5 0 or more | How long the in animation takes; drag the inner edge of its ramp in Cook to change it. |
| OutAnimation | string | None None, Fade, Slide, Pop, Typewriter, Wipe | The animation it goes out with, applied when drawn, so keys and scripts are untouched. |
| OutDuration | number | 0.5 0 or more | How long the out animation takes; drag the inner edge of its ramp in Cook to change it. |
| SlideDirection | string | Left Left, Right, Up, Down |
Appearance
| BlendMode | string | Normal Normal, Dissolve, Darken, Multiply, ColorBurn, ClassicColorBurn, LinearBurn, DarkerColor, Lighten, Screen, ColorDodge, ClassicColorDodge, Add, LighterColor, Overlay, SoftLight, HardLight, VividLight, LinearLight, PinLight, HardMix, Difference, Exclusion, Subtract, Divide, Hue, Saturation, Color, Luminosity, StencilAlpha, StencilLuma, SilhouetteAlpha, SilhouetteLuma, AlphaAdd, LuminescentPremul | How it lands on what is below, with every Photoshop and After Effects blend mode. |
| Color | Color3 | 1, 1, 1 | The tint it is drawn with; an Image2D in a DataModel ignores it. |
| Transparency | number | 0 0 to 1 | The fade it is drawn with. |
Layer Style
| FillOpacity | number | 1 0 to 1 | Like Photoshop's Fill: fades the layer's own pixels but not its layer styles. |
Image
Methods
| Name | Arguments | Returns | Description |
|---|---|---|---|
| Animate | (options: { In: ("None" | "Fade" | "Slide" | "Pop" | "Typewriter" | "Wipe")?, Out: ("None" | "Fade" | "Slide" | "Pop" | "Typewriter" | "Wipe")?, Duration: number?, InDuration: number?, OutDuration: number?, From: ("Left" | "Right" | "Up" | "Down")?, Easing: ("Smooth" | "Linear" | "Back")?, Start: number?, End: number? }) | () | The Luau way to give it in and out animations. |
From Instance 22
Subclasses
