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.

InstanceabstractCook

Properties

Scripts

NameTypeDefaultDescription
AbsolutePositionVector2scripts onlyThe top-left of its drawn box on the canvas; read-only.

Layout

AnchorPointVector20, 0The point that sits at Position; it is drawn and scaled around this point.
PositionVector240, 40In 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.
ScaleVector21, 1Grows or shrinks it in place, text and strokes too; a negative Scale mirrors pictures.
VisiblebooleantrueHides it when set to false.
ZIndexnumber1
any value
Higher draws on top; ties are stacked in tree order.

Animation

AnimationEasingstringSmooth
Smooth, Linear, Back
AnimationEndnumber-1
any value
AnimationStartnumber0
any value
InAnimationstringNone
None, Fade, Slide, Pop, Typewriter, Wipe
The animation it comes in with, applied when drawn, so keys and scripts are untouched.
InDurationnumber0.5
0 or more
How long the in animation takes; drag the inner edge of its ramp in Cook to change it.
OutAnimationstringNone
None, Fade, Slide, Pop, Typewriter, Wipe
The animation it goes out with, applied when drawn, so keys and scripts are untouched.
OutDurationnumber0.5
0 or more
How long the out animation takes; drag the inner edge of its ramp in Cook to change it.
SlideDirectionstringLeft
Left, Right, Up, Down

Appearance

BlendModestringNormal
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