Class BannerAdSize
Specifies a size for a Banner Ad.
Inherited Members
Namespace: Unity.Services.Mediation
Assembly: Unity.Mediation.dll
Syntax
public class BannerAdSize
Constructors
BannerAdSize(int, int)
Constructs a Banner Size in pixel format
Declaration
public BannerAdSize(int width, int height)
Parameters
| Type | Name | Description |
|---|---|---|
| int | width | Width of Banner in pixels |
| int | height | Height of Banner in pixels |
BannerAdSize(BannerAdPredefinedSize)
Constructs a Banner Size from a predefined size
Declaration
public BannerAdSize(BannerAdPredefinedSize size)
Parameters
| Type | Name | Description |
|---|---|---|
| BannerAdPredefinedSize | size | size in a BannerAdPredefinedSize form |
BannerAdSize(Vector2)
Constructs a Banner Size from a Vector2 in pixel format
Declaration
public BannerAdSize(Vector2 size)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | size | size in a Vector2 pixels form |
Properties
DpHeight
Retrieves the Height of this Banner Size in dp.
Declaration
public int DpHeight { get; }
Property Value
| Type | Description |
|---|---|
| int |
DpWidth
Retrieves the Width of this Banner Size in dp.
Declaration
public int DpWidth { get; }
Property Value
| Type | Description |
|---|---|
| int |
Height
Retrieves the Height of this Banner Size in pixels.
Declaration
public int Height { get; }
Property Value
| Type | Description |
|---|---|
| int |
Width
Retrieves the Width of this Banner Size in pixels.
Declaration
public int Width { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
Equals(object)
Determines object equivalency.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | Other object |
Returns
| Type | Description |
|---|---|
| bool | whether objects are equal |
Overrides
Equals(BannerAdSize)
Determines object equivalency.
Declaration
protected bool Equals(BannerAdSize other)
Parameters
| Type | Name | Description |
|---|---|---|
| BannerAdSize | other | Other object |
Returns
| Type | Description |
|---|---|
| bool | whether objects are equal |
FromDpUnits(int, int)
Constructs a Banner Size from dp units
Declaration
public static BannerAdSize FromDpUnits(int dpWidth, int dpHeight)
Parameters
| Type | Name | Description |
|---|---|---|
| int | dpWidth | Width of Banner in dp |
| int | dpHeight | Height of Banner in dp |
Returns
| Type | Description |
|---|---|
| BannerAdSize | A Banner Ad Size based on dp units received |
GetHashCode()
Retrieves the hash for this object
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | object hash |
Overrides
Operators
implicit operator Vector2(BannerAdSize)
Cast to Vector2
Declaration
public static implicit operator Vector2(BannerAdSize size)
Parameters
| Type | Name | Description |
|---|---|---|
| BannerAdSize | size | Banner Ad Size |
Returns
| Type | Description |
|---|---|
| Vector2 | Vector2 version of size |
implicit operator BannerAdSize(Vector2)
Cast Vector2 to banner ad size.
Declaration
public static implicit operator BannerAdSize(Vector2 size)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | size | Banner ad size. |
Returns
| Type | Description |
|---|---|
| BannerAdSize | Banner ad size object. |