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: Image2D, Text2D, Frame2D and the video layers. It is a rectangle in pixels from the top-left: its AnchorPoint sits at Position, and it is drawn Size times Scale around that point; a negative Scale mirrors pictures. Color tints, Transparency fades and BlendMode picks one of 35 blend modes. InAnimation and OutAnimation (Fade, Slide, Pop, Typewriter, Wipe) play as it comes and goes; layer:Animate{...} sets them from a script.
Properties
Layout
| Name | Type | Default | Description |
|---|---|---|---|
| AnchorPoint | Vector2 | 0, 0 | The point that sits at Position; it is drawn and scaled around this point. |
| Position | Vector2 | 40, 40 | Where it sits, in pixels of the DataModel's image from its top-left, like Roblox GUI. |
| 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 | Higher draws on top; ties are stacked in tree order. |
Animation
| AnimationEasing | string | "Smooth" Smooth, Linear, Back | |
| AnimationEnd | number | -1 | |
| AnimationStart | number | 0 | |
| 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 to 1e+06 | 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 to 1e+06 | 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
| Size | Vector2 | varies (Image2D 200, 200; Text2D 320, 60; Frame2D 200, 80) | Its size before Scale: it is drawn Size times Scale around its AnchorPoint. |
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
