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.

InstanceabstractCook

Properties

Layout

NameTypeDefaultDescription
AnchorPointVector20, 0The point that sits at Position; it is drawn and scaled around this point.
PositionVector240, 40Where it sits, in pixels of the DataModel's image from its top-left, like Roblox GUI.
ScaleVector21, 1Grows or shrinks it in place, text and strokes too; a negative Scale mirrors pictures.
VisiblebooleantrueHides it when set to false.
ZIndexnumber1Higher draws on top; ties are stacked in tree order.

Animation

AnimationEasingstring"Smooth"
Smooth, Linear, Back
AnimationEndnumber-1
AnimationStartnumber0
InAnimationstring"None"
None, Fade, Slide, Pop, Typewriter, Wipe
The animation it comes in with, applied when drawn, so keys and scripts are untouched.
InDurationnumber0.5
0 to 1e+06
How long the in animation takes; drag the inner edge of its ramp in Cook to change it.
OutAnimationstring"None"
None, Fade, Slide, Pop, Typewriter, Wipe
The animation it goes out with, applied when drawn, so keys and scripts are untouched.
OutDurationnumber0.5
0 to 1e+06
How long the out animation takes; drag the inner edge of its ramp in Cook to change it.
SlideDirectionstring"Left"
Left, Right, Up, Down

Appearance

BlendModestring"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.
ColorColor31, 1, 1The tint it is drawn with; an Image2D in a DataModel ignores it.
Transparencynumber0
0 to 1
The fade it is drawn with.

Layer Style

FillOpacitynumber1
0 to 1
Like Photoshop's Fill: fades the layer's own pixels but not its layer styles.

Image

SizeVector2varies (Image2D 200, 200; Text2D 320, 60; Frame2D 200, 80)Its size before Scale: it is drawn Size times Scale around its AnchorPoint.

Methods

NameArgumentsReturnsDescription
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