Skip to content

CanvasFrame

A frame that seamlessly switches between a CanvasGroup and a Frame based on it's content.

Usage

Simply put, just wrap your content in a CanvasFrame as if it was a normal Frame and adjust the transparency accordingly. A CanvasFrame is designed for seamless compatibility with existing content, so you can use it as a drop-in replacement for a Frame.

Properties

GroupTransparency

The transparency of the content. The CanvasFrame switches between it's states based on the following conditions:

  • invisible: GroupTransparency is larger than 0.99999 or Visible is false.
  • canvas: GroupTransparency is higher than 0.00001.
  • frame: GroupTransparency is lower than 0.00001.

There may be a frame of delay when switching from frame to canvas, as CanvasGroups are rendered as a texture, so they need a frame or so to render.

Type

luau

Code block has not loaded. An error may have occurred.

Visible

Type

luau

Code block has not loaded. An error may have occurred.

Children

Type

luau

Code block has not loaded. An error may have occurred.

Shadow

This expects a theme color to be passed. The shadow field will be retrieved from it. This way, the canvas can dynamically render shadows without causing sizing conflicts.

Components like popover have this built-in, but if you wish to implement this on your own components, simply pass in a theme color that has a shadow field.

Type

luau

Code block has not loaded. An error may have occurred.

Instance Properties

This instance takes all the properties of a Frame. SpecialKeys, such as fusion.Children will also be passed to the instance.