Roblox UtilitiesDevlHub Roblox Documentation

Class

AdGui

Memory category
Internal

A surface-based GUI that displays immersive ads on a face of a Part in the 3D world.

AdGui is a SurfaceGuiBase that renders immersive display ads onto a face of the Part it's adorned to. When no ad is available, it shows the creator-supplied AdGui.FallbackImage, or a default Roblox fallback image when that property is empty.

To render ads, the AdGui must be adorned to a block Part that's a descendant of Workspace, must be the only surface GUI on that face, and must be at least the minimum eligible size. When these conditions aren't met, the object displays a placeholder image in Studio's edit view and renders nothing in a running experience.

Properties 5#

AdShapeAdShapeDetermines the shape of the ad displayed by the AdGui.ReadSafe
EnableVideoAdsbooleanEnables the AdGui to serve video ads.ReadSafe
FallbackImageContentIdThe image the AdGui displays when no ad is available to serve.ReadSafe
FallbackImageContentContentThe Content equivalent of AdGui.FallbackImage that supports asset URIs and EditableImage objects.ReadSafe
StatusAdUnitStatusIndicates whether the AdGui is currently displaying a served ad.ReadSafeReadOnlyNotReplicated

AdShape: AdShape#

ReadSafe

Determines the shape of the ad rendered by the AdGui, including the creative's aspect ratio on the part surface. Defaults to HorizontalRectangle, which is the only served shape aside from the sentinel Undefined.

EnableVideoAds: boolean#

ReadSafe

The property enables the AdGui to serve video ads.

FallbackImage: ContentId#

ReadSafe

A creator-supplied image that the AdGui displays when it has no served ad to render. Defaults to an empty content string; while empty, the AdGui renders a default Roblox fallback image instead.

FallbackImageContent: Content#

ReadSafe

A Content-typed property that holds the fallback image the AdGui displays when no served ad is available. It is the content-typed backing for AdGui.FallbackImage (a legacy TextureId string); writing to either property updates the same underlying storage. Unlike FallbackImage, this property accepts asset URIs and references to EditableImage objects. When empty, the AdGui renders a default Roblox fallback image instead.

Status: AdUnitStatus#

ReadOnlyNotReplicatedReadSafe

A read-only property that reports whether the AdGui is actively displaying a served ad. It's Active when the AdGui is rendering ad content, and Inactive otherwise.

Callbacks 1#

OnAdEventUsed to react to the AdGui events.Deprecated

OnAdEvent(eventInfo: Dictionary): boolean#

DeprecatedDeprecated

Deprecated. This callback has been deprecated and will never be called.

Used to react to the AdGui events.

NameTypeDefaultDescription
eventInfoDictionary

Options table for the method:

  • PlayerId – The user ID of the player related to the ad event.
  • AdEventType – A AdEventType enum value describing the AdGui events.
Returns
  • boolean — Whether the callback has successfully reacted to the event.

Inherited members#

Inherited from SurfaceGuiBase 3
Properties (3)

Active, Adornee, Face

Inherited from LayerCollector 4
Inherited from GuiBase2d 12
Inherited from Instance 58
Inherited from Object 6
Properties (2)

ClassName, className

Events (1)

Changed