Show raw api
{
"functions": [
{
"name": "new",
"desc": "Constructs a new viewport. Unlike a normal [BasicPane] this will not render anything\nimmediately. See [Viewport.Render] for details.",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "Viewport"
}
],
"function_type": "static",
"source": {
"line": 63,
"path": "src/viewport/src/Client/Viewport.lua"
}
},
{
"name": "blend",
"desc": "Creates a Viewport and render it to Blend. The following properties are supported\n\n* Ambient - Color3\n* AnchorPoint - Vector2\n* FieldOfView - number\n* Instance - Instance\n* LayoutOrder - number\n* LightColor - Color3\n* Parent - Instance\n* Position - UDim2\n* Size - Vector3\n* Transparency - number\n\nProperties may be anything Blend would take as computable. See [Blend] for details.",
"params": [
{
"name": "props",
"desc": "",
"lua_type": "{ string }"
}
],
"returns": [
{
"desc": "",
"lua_type": "Observable<Instance>"
}
],
"function_type": "static",
"source": {
"line": 102,
"path": "src/viewport/src/Client/Viewport.lua"
}
},
{
"name": "SetControlsEnabled",
"desc": "Sets the enabled state of the ViewportControls",
"params": [
{
"name": "self",
"desc": "",
"lua_type": "Viewport"
},
{
"name": "enabled",
"desc": "",
"lua_type": "boolean"
}
],
"returns": [],
"function_type": "static",
"source": {
"line": 130,
"path": "src/viewport/src/Client/Viewport.lua"
}
},
{
"name": "SetTransparency",
"desc": "Sets the field of view on the viewport.",
"params": [
{
"name": "self",
"desc": "",
"lua_type": "Viewport"
},
{
"name": "transparency",
"desc": "",
"lua_type": "number"
}
],
"returns": [],
"function_type": "static",
"source": {
"line": 141,
"path": "src/viewport/src/Client/Viewport.lua"
}
},
{
"name": "SetFieldOfView",
"desc": "Sets the field of view on the viewport.",
"params": [
{
"name": "self",
"desc": "",
"lua_type": "Viewport"
},
{
"name": "fieldOfView",
"desc": "",
"lua_type": "number"
}
],
"returns": [],
"function_type": "static",
"source": {
"line": 150,
"path": "src/viewport/src/Client/Viewport.lua"
}
},
{
"name": "SetInstance",
"desc": "Set the instance to be rendered. The instance will be reparented\nto the viewport.\n\n:::warning\nThe instance you set here will NOT be destroyed by the viewport. This lets the\nperformance be optimized or the instance used in good transitions. However,\nbe sure to destroy it if you need to.\n:::",
"params": [
{
"name": "self",
"desc": "",
"lua_type": "Viewport"
},
{
"name": "instance",
"desc": "",
"lua_type": "Instance?"
}
],
"returns": [
{
"desc": "",
"lua_type": "() -> ()\n"
}
],
"function_type": "static",
"source": {
"line": 166,
"path": "src/viewport/src/Client/Viewport.lua"
}
},
{
"name": "NotifyInstanceSizeChanged",
"desc": "Notifies the viewport of the instance size changing. We don't connect to\nany events here because the instance can be anything.",
"params": [
{
"name": "self",
"desc": "",
"lua_type": "Viewport"
}
],
"returns": [],
"function_type": "static",
"source": {
"line": 180,
"path": "src/viewport/src/Client/Viewport.lua"
}
},
{
"name": "Render",
"desc": "Renders the viewport. Allows the following properties.\n\n* Ambient - Color3\n* ImageColor3 - Color3\n* AnchorPoint - Vector2\n* LayoutOrder - number\n* LightColor - Color3\n* Parent - Instance\n* Position - UDim2\n* Size - Vector3\n* Transparency - number\n\n:::warning\nThis should only be called once per a Viewport instance, since the Instance property is\nnot duplicated.\n:::",
"params": [
{
"name": "self",
"desc": "",
"lua_type": "Viewport"
},
{
"name": "props",
"desc": "",
"lua_type": "{ any }"
}
],
"returns": [
{
"desc": "",
"lua_type": "Observable<ViewportFrame>"
}
],
"function_type": "static",
"source": {
"line": 229,
"path": "src/viewport/src/Client/Viewport.lua"
}
}
],
"properties": [],
"types": [],
"name": "Viewport",
"desc": "Creates a ViewportFrame with size fitting and drag controls. This means that the\nviewport will center the camera around the given instance, and allow the user\nto control the camera itself.\n\n```lua\nlocal viewport = Viewport.new()\nviewport:SetInstance(instance)\n\nmaid:GiveTask(viewport:Render({\n\tParent = target;\n}):Subscribe())\n```",
"source": {
"line": 18,
"path": "src/viewport/src/Client/Viewport.lua"
}
}