Reference API Roblox

Engine API

Website

Related

Reference API Roblox

ViewportFrame

GuiObject that can display children 3D objects.

Member index 10

HistoryMember
553Ambient: Color3
553CurrentCamera: Camera
553ImageColor3: Color3
553ImageTransparency: float
553LightColor: Color3
553LightDirection: Vector3
645CaptureSnapshotAsync(): ContentId
inherited from GuiObject
553Active: bool
553AnchorPoint: Vector2
553AutomaticSize: AutomaticSize
553BackgroundColor3: Color3
553BackgroundTransparency: float
553BorderColor3: Color3
553BorderMode: BorderMode
553BorderSizePixel: int
553ClipsDescendants: bool
553Draggable: bool
588GuiState: GuiState
589Interactable: bool
553LayoutOrder: int
553NextSelectionDown: GuiObject
553NextSelectionLeft: GuiObject
553NextSelectionRight: GuiObject
553NextSelectionUp: GuiObject
553Position: UDim2
553Rotation: float
553Selectable: bool
553SelectionImageObject: GuiObject
553SelectionOrder: int
553Size: UDim2
553SizeConstraint: SizeConstraint
553Visible: bool
553ZIndex: int
462TweenPosition(endPosition: UDim2, easingDirection: EasingDirection = Out, easingStyle: EasingStyle = Quad, time: float = 1, override: bool = false, callback: Function = nil): bool
462TweenSize(endSize: UDim2, easingDirection: EasingDirection = Out, easingStyle: EasingStyle = Quad, time: float = 1, override: bool = false, callback: Function = nil): bool
462TweenSizeAndPosition(endSize: UDim2, endPosition: UDim2, easingDirection: EasingDirection = Out, easingStyle: EasingStyle = Quad, time: float = 1, override: bool = false, callback: Function = nil): bool
462DragBegin(initialPosition: UDim2)
462DragStopped(x: int, y: int)
483InputBegan(input: InputObject)
483InputChanged(input: InputObject)
483InputEnded(input: InputObject)
462MouseEnter(x: int, y: int)
462MouseLeave(x: int, y: int)
462MouseMoved(x: int, y: int)
462MouseWheelBackward(x: int, y: int)
462MouseWheelForward(x: int, y: int)
462SelectionGained()
462SelectionLost()
462TouchLongPress(touchPositions: Array, state: UserInputState)
462TouchPan(touchPositions: Array, totalTranslation: Vector2, velocity: Vector2, state: UserInputState)
462TouchPinch(touchPositions: Array, scale: float, velocity: float, state: UserInputState)
462TouchRotate(touchPositions: Array, rotation: float, velocity: float, state: UserInputState)
462TouchSwipe(swipeDirection: SwipeDirection, numberOfTouches: int)
462TouchTap(touchPositions: Array)
inherited from GuiBase2d
553AbsolutePosition: Vector2
553AbsoluteRotation: float
553AbsoluteSize: Vector2
553AutoLocalize: bool
553RootLocalizationTable: LocalizationTable
553SelectionBehaviorDown: SelectionBehavior
553SelectionBehaviorLeft: SelectionBehavior
553SelectionBehaviorRight: SelectionBehavior
553SelectionBehaviorUp: SelectionBehavior
553SelectionGroup: bool
525SelectionChanged(amISelected: bool, previousSelection: GuiObject, newSelection: GuiObject)
inherited from Instance
553Archivable: bool
635Capabilities: SecurityCapabilities
553Name: string
553Parent: Instance
635Sandboxed: bool
616UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
486GetDescendants(): Array
486GetFullName(): string
641GetStyled(name: string): Variant
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
580IsPropertyModified(name: string): bool
573Remove(): null
576RemoveTag(tag: string): null
580ResetPropertyToDefault(name: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

Description

ViewportFrame is a GuiObject that can render 3D objects inside its bounds, offering a way to display 3D objects in a 2D space like a ScreenGui. This object has the following caveats:

History 33

Members 10

Ambient

TypeDefault
Color30.784314, 0.784314, 0.784314

This property determines the lighting hue applied to the area within the ViewportFrame. Defaults to Color3.fromRGB(200, 200, 200) (ghost grey).

History 4

CaptureSnapshotAsync

Parameters (0)
No parameters.
Returns (1)
ContentId
This function yields. It will block the calling thread until completion.

History 2

Tags: [Yields]

CurrentCamera

TypeDefault
Camera

Camera instance that is used to render children objects. Defaults to nil.

The Camera object does not replicate so the ViewportFrame.CurrentCamera won't replicate either. When you set this property, Camera.CFrame and Camera.FieldOfView will be saved and replicate with ViewportFrame internally so the client can render the frame without a Camera object.

This property is not replicated. Its interface does not cross the network boundary.

History 6

Tags: [NotReplicated]

ImageColor3

TypeDefault
Color31, 1, 1

This property determines how a rendered image will be colorized, allowing you to change the image color without directly modifying the rendered object. The default colorization value is Color3.new(1, 1, 1) (white) at which no color modification occurs.

See also ImageTransparency which determines the transparency of the rendered image.

History 4

ImageTransparency

TypeDefault
float0

This property determines the transparency of the rendered image, allowing you to change the image transparency without directly modifying the rendered object. A value of 0 (default) is completely opaque and a value of 1 is completely transparent (invisible).

See also ImageColor3 which determines how a rendered image will be colorized.

History 4

LightColor

TypeDefault
Color30.54902, 0.54902, 0.54902

The color of the emitted light. Defaults to Color3.fromRGB(140, 140, 140) (silver).

History 4

LightDirection

TypeDefault
Vector3-1, -1, -1

A Vector3 representing the direction of the light source from position Vector3.new(0, 0, 0). Defaults to Vector3.new(-1, -1, -1).

History 4

Settings