Skip to content

Commit

Permalink
docs: minimize README #82
Browse files Browse the repository at this point in the history
  • Loading branch information
gumaciel committed Aug 23, 2023
1 parent 80e4481 commit 7f6e94c
Showing 1 changed file with 54 additions and 10 deletions.
64 changes: 54 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,47 @@ This addon provides an easy and beautiful way to configure AdMob directly throug
- Video Tutorial - Soon

# Installation
## Godot Asset Library (recommended)

Godot Asset Library (recommended):
1. Find the AdMob plugin by `poing.studios` \
<img height=100 src="static/asset_library.png">
2. Click Download and Install
3. Enable in Project→Project Settings→Plugins.
4. Download [godot-admob-android](https://github.com/Poing-Studios/godot-admob-android) and/or [godot-admob-ios](https://github.com/Poing-Studios/godot-admob-ios) in `Project→Tools→AdMob Download Manager→Android/iOS→LatestVersion`.
5. To know how to deploy, check the README.md of [godot-admob-android](https://github.com/Poing-Studios/godot-admob-android/#usage) and/or [godot-admob-ios](https://github.com/Poing-Studios/godot-admob-ios/#usage).

Manual install for custom versions:
<details>
<summary>Manual install for custom versions.</summary>

1. Pick a [specific version](https://github.com/Poing-Studios/godot-admob-editor/tags) from tags
2. Download and extract as a `.zip` or `.tar.gz`
3. Copy the extracted `addons/admob` folder into `res://addons` on your project
4. Download [godot-admob-android](https://github.com/Poing-Studios/godot-admob-android) and/or [godot-admob-ios](https://github.com/Poing-Studios/godot-admob-ios) in `Project→Tools→AdMob Download Manager→Android/iOS→LatestVersion`.
5. To know how to deploy, check the README.md of [godot-admob-android](https://github.com/Poing-Studios/godot-admob-android/#usage) and/or [godot-admob-ios](https://github.com/Poing-Studios/godot-admob-ios/#usage).

</details>

# How to use
After installation, all the methods will be available for use in any `.gd` script.

# Examples

## Initialize AdMob
<details>
<summary>Initialize AdMob</summary>

```gdscript
func _ready() -> void:
#just need to call once
MobileAds.initialize()
```

</details>

## Banner Ads
### Load (will automatically shows)

<details>
<summary>Load (will automatically shows)</summary>

```gdscript
# button signal on scene
func _on_load_banner_pressed() -> void:
Expand All @@ -51,8 +63,13 @@ func _on_load_banner_pressed() -> void:
var ad_view := AdView.new(unit_id, AdSize.BANNER, AdPosition.Values.TOP)
ad_view.load_ad(AdRequest.new())
```

</details>

## Interstitial Ads
### Load
<details>
<summary>Load</summary>

```gdscript
var interstitial_ad : InterstitialAd
var interstitial_ad_load_callback := InterstitialAdLoadCallback.new()
Expand All @@ -76,16 +93,26 @@ func on_interstitial_ad_failed_to_load(adError : LoadAdError) -> void:
func on_interstitial_ad_loaded(interstitial_ad : InterstitialAd) -> void:
self.interstitial_ad = interstitial_ad
```
### Show

</details>

<details>
<summary>Show</summary>

```gdscript
# button signal on scene
func _on_show_pressed():
if interstitial_ad:
interstitial_ad.show()
```

</details>

## Rewarded Ads
### Load

<details>
<summary>Load</summary>

```gdscript
var rewarded_ad : RewardedAd
var rewarded_ad_load_callback := RewardedAdLoadCallback.new()
Expand All @@ -110,16 +137,25 @@ func on_rewarded_ad_failed_to_load(adError : LoadAdError) -> void:
func on_rewarded_ad_loaded(rewarded_ad : RewardedAd) -> void:
self.rewarded_ad = rewarded_ad
```
### Show

</details>

<details>
<summary>Show</summary>

```gdscript
# button signal on scene
func _on_show_pressed():
if rewarded_ad:
rewarded_ad.show()
```

</details>

## Rewarded Interstitial Ads
### Load
<details>
<summary>Load</summary>

```gdscript
var rewarded_interstitial_ad : RewardedInterstitialAd
var rewarded_interstitial_ad_load_callback := RewardedInterstitialAdLoadCallback.new()
Expand All @@ -144,14 +180,22 @@ func on_rewarded_interstitial_ad_failed_to_load(adError : LoadAdError) -> void:
func on_rewarded_interstitial_ad_loaded(rewarded_interstitial_ad : RewardedInterstitialAd) -> void:
self.rewarded_interstitial_ad = rewarded_interstitial_ad
```
### Show

</details>


<details>
<summary>Show</summary>

```gdscript
# button signal on scene
func _on_show_pressed():
if rewarded_interstitial_ad:
rewarded_interstitial_ad.show(on_user_earned_reward_listener)
```

</details>

# Documentation
For a complete documentation of this Plugin including how to mediation: [check here](docs).

Expand Down

0 comments on commit 7f6e94c

Please sign in to comment.