NendUnityPlugin 5.2.0
Public Member Functions | List of all members
NendUnityPlugin.Layout.NendAdIconLayoutBuilder Class Reference

Builder to set layout of icon ad. More...

Inheritance diagram for NendUnityPlugin.Layout.NendAdIconLayoutBuilder:
NendUnityPlugin.Layout.NendAdDefaultLayoutBuilder NendUnityPlugin.Layout.NendAdLayoutBuilder

Public Member Functions

NendAdIconLayoutBuilder Orientation (Orientation orientation)
 Set orientation. More...
 
NendAdIconLayoutBuilder Gravity (int tag, int gravity)
 Set gravity to icon of specific tag. More...
 
NendAdIconLayoutBuilder MarginLeft (int tag, float value)
 Set left margin to icon of specific tag. More...
 
NendAdIconLayoutBuilder MarginTop (int tag, float value)
 Set top margin to icon of specific tag. More...
 
NendAdIconLayoutBuilder MarginRight (int tag, float value)
 Set right margin to icon of specific tag. More...
 
NendAdIconLayoutBuilder MarginBottom (int tag, float value)
 Set bottom margin to icon of specific tag. More...
 
NendAdIconLayoutBuilder Size (int tag, int size)
 Set size to icon of specific tag. More...
 
NendAdIconLayoutBuilder SpaceEnabled (int tag, bool enabled)
 Set presence or absence of space to icon of specific tag. More...
 
NendAdIconLayoutBuilder TitleVisible (int tag, bool titleVisible)
 Set presence or absence of the display of title to icon of specific tag. More...
 
NendAdIconLayoutBuilder TitleColor (int tag, string titleColor)
 Set title color to icon of specific tag. More...
 
- Public Member Functions inherited from NendUnityPlugin.Layout.NendAdDefaultLayoutBuilder
NendAdDefaultLayoutBuilder Unit (ComplexUnit unit)
 Set unit of numeric value. More...
 
NendAdDefaultLayoutBuilder Gravity (int gravity)
 Set gravity. More...
 
NendAdDefaultLayoutBuilder MarginLeft (float value)
 Set left margin. More...
 
NendAdDefaultLayoutBuilder MarginTop (float value)
 Set top margin. More...
 
NendAdDefaultLayoutBuilder MarginRight (float value)
 Set right margin. More...
 
NendAdDefaultLayoutBuilder MarginBottom (float bottom)
 Set bottom margin. More...
 

Detailed Description

Builder to set layout of icon ad.

e.g. Place icon ad aligned horizontally in the upper right of the screen, leaving little margin.

NendAdIcon icon = ...; // Get NendAdIcon instance.
icon.Layout (new NendAdIconLayoutBuilder ()
.Orientation (Orientation.HORIZONTAL)
.Gravity ((int)Gravity.TOP | (int)Gravity.RIGHT)
.MarginTop (16)
.MarginRight (16));
NendAdIconLayoutBuilder Orientation(Orientation orientation)
Set orientation.
Definition: NendAdIconLayoutBuilder.cs:74
NendAdIconLayoutBuilder Gravity(int tag, int gravity)
Set gravity to icon of specific tag.
Definition: NendAdIconLayoutBuilder.cs:88
NendAdIconLayoutBuilder MarginTop(int tag, float value)
Set top margin to icon of specific tag.
Definition: NendAdIconLayoutBuilder.cs:114
NendAdIconLayoutBuilder MarginRight(int tag, float value)
Set right margin to icon of specific tag.
Definition: NendAdIconLayoutBuilder.cs:127

The layout of each icon ad can be changed with specifying icon add tag to each methods. The tag can be set at UnityPlayer's Inspector.

e.g. Place icon ad on the screen four corners, leaving little margin.

// Set tag of 0-3 to four icon ads.
NendAdIcon icon = ...; // Get NendAdIcon instance.
icon.Layout (new NendAdIconLayoutBuilder ()
.Orientation (Orientation.UNSPECIFIED) // Not aligned.
.Gravity (0, (int)Gravity.TOP | (int)Gravity.LEFT)
.MarginLeft (0, 8)
.MarginTop (0, 8)
.Gravity (1, (int)Gravity.TOP | (int)Gravity.RIGHT)
.MarginRight (1, 8)
.MarginTop (1, 8)
.Gravity (2, (int)Gravity.BOTTOM | (int)Gravity.LEFT)
.MarginLeft (2, 8)
.MarginBottom (2, 8)
.Gravity (3, (int)Gravity.BOTTOM | (int)Gravity.RIGHT)
.MarginRight (3, 8)
.MarginBottom (3, 8));
NendAdIconLayoutBuilder MarginLeft(int tag, float value)
Set left margin to icon of specific tag.
Definition: NendAdIconLayoutBuilder.cs:101
NendAdIconLayoutBuilder MarginBottom(int tag, float value)
Set bottom margin to icon of specific tag.
Definition: NendAdIconLayoutBuilder.cs:140

e.g. Place icon ad in specific size.

// Set tag of 0-3 to four icon ads.
NendAdIcon icon = ...; // Get NendAdIcon instance.
icon.Layout (new NendAdIconLayoutBuilder ()
.Orientation (Orientation.HORIZONTAL) // Horizontal aligned.
.Size (0, 120)
.Size (1, 80)
.Size (2, 120)
.Size (3, 80));
NendAdIconLayoutBuilder Size(int tag, int size)
Set size to icon of specific tag.
Definition: NendAdIconLayoutBuilder.cs:153

Member Function Documentation

◆ Orientation()

NendAdIconLayoutBuilder NendUnityPlugin.Layout.NendAdIconLayoutBuilder.Orientation ( Orientation  orientation)

Set orientation.

Returns
This instance.
Parameters
orientationOrientation.
Remarks
Default is horizontal.
See also
NendUnityPlugin.Common.Orientation

◆ Gravity()

NendAdIconLayoutBuilder NendUnityPlugin.Layout.NendAdIconLayoutBuilder.Gravity ( int  tag,
int  gravity 
)

Set gravity to icon of specific tag.

Returns
This instance.
Parameters
tagTag of icon.
gravityGravity.
Remarks
Default is 0 (no gravity).
See also
NendUnityPlugin.Common.Gravity

◆ MarginLeft()

NendAdIconLayoutBuilder NendUnityPlugin.Layout.NendAdIconLayoutBuilder.MarginLeft ( int  tag,
float  value 
)

Set left margin to icon of specific tag.

Returns
This instance.
Parameters
tagTag of icon.
valueValue of left margin.
Remarks
Default is 0.

◆ MarginTop()

NendAdIconLayoutBuilder NendUnityPlugin.Layout.NendAdIconLayoutBuilder.MarginTop ( int  tag,
float  value 
)

Set top margin to icon of specific tag.

Returns
This instance.
Parameters
tagTag of icon.
valueValue of top margin.
Remarks
Default is 0.

◆ MarginRight()

NendAdIconLayoutBuilder NendUnityPlugin.Layout.NendAdIconLayoutBuilder.MarginRight ( int  tag,
float  value 
)

Set right margin to icon of specific tag.

Returns
This instance.
Parameters
tagTag of icon.
valueValue of right margin.
Remarks
Default is 0.

◆ MarginBottom()

NendAdIconLayoutBuilder NendUnityPlugin.Layout.NendAdIconLayoutBuilder.MarginBottom ( int  tag,
float  value 
)

Set bottom margin to icon of specific tag.

Returns
This instance.
Parameters
tagTag of icon.
bottomValue of bottom margin.
Remarks
Default is 0.

◆ Size()

NendAdIconLayoutBuilder NendUnityPlugin.Layout.NendAdIconLayoutBuilder.Size ( int  tag,
int  size 
)

Set size to icon of specific tag.

Returns
This instance.
Parameters
tagTag of icon.
sizeSize of icon.
Remarks
Default is the previous value.

◆ SpaceEnabled()

NendAdIconLayoutBuilder NendUnityPlugin.Layout.NendAdIconLayoutBuilder.SpaceEnabled ( int  tag,
bool  enabled 
)

Set presence or absence of space to icon of specific tag.

Returns
This instance.
Parameters
tagTag of icon.
enabledIf set to true, space of icon enabled.
Remarks
Default is true.

◆ TitleVisible()

NendAdIconLayoutBuilder NendUnityPlugin.Layout.NendAdIconLayoutBuilder.TitleVisible ( int  tag,
bool  titleVisible 
)

Set presence or absence of the display of title to icon of specific tag.

Returns
This instance.
Parameters
tagTag of icon.
titleVisibleIf set to true, title of icon visible.
Remarks
Default is true.

◆ TitleColor()

NendAdIconLayoutBuilder NendUnityPlugin.Layout.NendAdIconLayoutBuilder.TitleColor ( int  tag,
string  titleColor 
)

Set title color to icon of specific tag.

Returns
This instance.
Parameters
tagTag of icon.
titleColorTitle color.

e.g. Set red.

NendAdIconLayoutBuilder builder = new NendAdIconLayoutBuilder ();
builder.TitleColor (0, "#FF0000");
Remarks
Default is "#000000"(Black).
Warning
Please specify in "#rrggbb" format.

The documentation for this class was generated from the following file: