# AdGui

Roblox Engine API class from Roblox Studio 0.744.0.7441077 (version-7aaa6838d36c4448).

- Inherits from, nearest first: [SurfaceGuiBase](https://rapi.sleaze.dev/classes/SurfaceGuiBase.md), [LayerCollector](https://rapi.sleaze.dev/classes/LayerCollector.md), [GuiBase2d](https://rapi.sleaze.dev/classes/GuiBase2d.md), [GuiBase](https://rapi.sleaze.dev/classes/GuiBase.md), [Instance](https://rapi.sleaze.dev/classes/Instance.md), [Object](https://rapi.sleaze.dev/classes/Object.md)
- Memory category: Internal
- HTML page: https://rapi.sleaze.dev/classes/AdGui/
- Roblox documentation: https://create.roblox.com/docs/reference/engine/classes/AdGui

A surface-based GUI that displays immersive ads on a face of a [`Part`](https://rapi.sleaze.dev/classes/Part.md) in the 3D world.

## Properties

### FallbackImage

```luau
AdGui.FallbackImage: string = ""
```

- Tags: Read capabilities: UI

The image the [`AdGui`](https://rapi.sleaze.dev/classes/AdGui.md) displays when no ad is available to serve.

### FallbackImageContent

```luau
AdGui.FallbackImageContent: Content
```

- Tags: Capabilities: UI

The [`Content`](https://rapi.sleaze.dev/index/types/Content.md) equivalent of [`AdGui.FallbackImage`](https://rapi.sleaze.dev/classes/AdGui.md) that supports asset URIs and [`EditableImage`](https://rapi.sleaze.dev/classes/EditableImage.md) objects.

### Status

```luau
AdGui.Status: Enum.AdUnitStatus = Enum.AdUnitStatus.Inactive
```

- Tags: Read only, Capabilities: Monetization + UI

Indicates whether the [`AdGui`](https://rapi.sleaze.dev/classes/AdGui.md) is currently displaying a served ad.

### AdShape

```luau
AdGui.AdShape: Enum.AdShape = Enum.AdShape.HorizontalRectangle
```

- Tags: Read capabilities: UI

Determines the shape of the ad displayed by the [`AdGui`](https://rapi.sleaze.dev/classes/AdGui.md).

### EnableVideoAds

```luau
AdGui.EnableVideoAds: boolean = true
```

- Tags: Capabilities: Monetization + UI

Enables the AdGui to serve video ads.

## Methods

### GetSingleReportAdInfo

```luau
AdGui:GetSingleReportAdInfo(): { [any]: any }
```

- Tags: Roblox script security, Capabilities: UI

### HandleLuaUIEvent

```luau
AdGui:HandleLuaUIEvent(eventType: Enum.AdUIEventType)
```

- Tags: Roblox script security, Capabilities: UI

### forwardStateToLuaUI

```luau
AdGui:forwardStateToLuaUI()
```

- Tags: Roblox script security, Capabilities: UI

## Events

### AdEvent

```luau
AdGui.AdEvent: RBXScriptSignal<(adEventType: Enum.AdEventType)>
```

- Tags: Hidden, Roblox engine security, Capabilities: UI

### ReportIsSubscribedToVideoCompletion

```luau
AdGui.ReportIsSubscribedToVideoCompletion: RBXScriptSignal<()>
```

- Tags: Hidden, Roblox engine security, Capabilities: UI

### adGuiStateChanged

```luau
AdGui.adGuiStateChanged: RBXScriptSignal<(adUIState: any)>
```

- Tags: Roblox script security, Capabilities: UI

## Callbacks

### OnAdEvent

```luau
AdGui.OnAdEvent: (eventInfo: { [string]: any }) -> boolean
```

- Tags: Deprecated, Capabilities: Monetization + UI

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

Used to react to the AdGui events.

Parameters:

- `eventInfo`: 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: Whether the callback has successfully reacted to the event.

## Inherited members

- From [SurfaceGuiBase](https://rapi.sleaze.dev/classes/SurfaceGuiBase.md): `Active`, `Adornee`, `Face`
- From [LayerCollector](https://rapi.sleaze.dev/classes/LayerCollector.md): `Enabled`, `ResetOnSpawn`, `TabKeyboardNavigation`, `ZIndexBehavior`, `GetGuiObjectsAtPosition`, `GetLayoutNodeTree`
- From [GuiBase2d](https://rapi.sleaze.dev/classes/GuiBase2d.md): `AbsolutePosition`, `AbsoluteRotation`, `AbsoluteSize`, `ActiveQueryNames`, `ReplicatedInsertionOrder`, `ClippedRect`, `IsNotOccluded`, `RawRect2D`, `TotalGroupScale`, `AutoLocalize`, `RootLocalizationTable`, `Localize`, `SelectionBehaviorDown`, `SelectionBehaviorLeft`, `SelectionBehaviorRight`, `SelectionBehaviorUp`, `SelectionGroup`, `SelectionChanged`
- From [Instance](https://rapi.sleaze.dev/classes/Instance.md): `Archivable`, `archivable`, `Attributes`, `AttributesReplicate`, `AttributesSerialize`, `HistoryId`, `Name`, `Parent`, `PredictionMode`, `PropertyStatusStudio`, `RobloxLocked`, `SerializedOverrides`, `SourceAssetId`, `Tags`, `UniqueId`, `numExpectedDirectChildren`, `DataCost`, `Capabilities`, `DefinesCapabilities`, `IsInSandbox`, `Sandboxed`, `AddTag`, `ClearAllChildren`, `Clone`, `Destroy`, `FindFirstAncestor`, `FindFirstAncestorOfClass`, `FindFirstAncestorWhichIsA`, `FindFirstChild`, `FindFirstChildOfClass`, `FindFirstChildWhichIsA`, `FindFirstDescendant`, `GetActor`, `GetAttribute`, `GetAttributeChangedSignal`, `GetAttributes`, `GetChildren`, `GetDebugId`, `GetDescendants`, `GetFullName`, `GetStyled`, `GetStyledPropertyChangedSignal`, `GetTags`, `HasTag`, `IsAncestorOf`, `IsDescendantOf`, `IsPropertyModified`, `QueryDescendants`, `RemoveTag`, `ResetPropertyToDefault`, `SetAttribute`, `WaitForChild`, `Remove`, `children`, `clone`, `destroy`, `findFirstChild`, `getChildren`, `isDescendantOf`, `remove`, `AncestryChanged`, `AttributeChanged`, `ChildAdded`, `ChildRemoved`, `DescendantAdded`, `DescendantRemoving`, `Destroying`, `StyledPropertiesChanged`, `childAdded`
- From [Object](https://rapi.sleaze.dev/classes/Object.md): `ClassName`, `className`, `GetPropertyChangedSignal`, `IsA`, `isA`, `Changed`
