Skip to content

Commit

Permalink
GD Banner ads support (#37)
Browse files Browse the repository at this point in the history
* Added gd banner support

* Version bump to 2.4.0

* Updated gd banner setup

* Allow destroying gd banner
  • Loading branch information
florisdh authored and AleBles committed Nov 15, 2019
1 parent a91f395 commit f5265e4
Show file tree
Hide file tree
Showing 10 changed files with 255 additions and 69 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.4.0] 2019-11-15
### Added
- GD banner ad support

## [2.3.1] - 2019-10-18
### Fixed
- [GameDistribution Ads] Content paused is now only fired when an ad is actually beeing displayed
24 changes: 22 additions & 2 deletions build/phaser-ads.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ declare module PhaserAds {
* @param args
*/
showAd(...args: any[]): void;
loadBanner(...args: any[]): any;
isRewardedAvailable(): boolean;
/**
* Some providers might require you to preload an ad before showing it, that can be done here
Expand Down Expand Up @@ -142,15 +143,33 @@ declare module PhaserAds {
module AdProvider {
enum GameDistributionAdType {
interstitial = "interstitial",
rewarded = "rewarded"
rewarded = "rewarded",
display = "display"
}
enum GameDistributionBannerSize {
LargeRectangle = 0,
MediumRectangle = 1,
Billboard = 2,
Leaderboard = 3,
Skyscraper = 4,
WideSkyscraper = 5
}
class GameDistributionBanner {
element: HTMLElement;
constructor();
loadBanner(): void;
destroy(): void;
setSize(size: GameDistributionBannerSize): void;
position(x: number, y: number): void;
}
class GameDistributionAds implements PhaserAds.AdProvider.IProvider {
adManager: AdManager;
adsEnabled: boolean;
hasRewarded: boolean;
constructor(game: Phaser.Game, gameId: string, userId?: string);
setManager(manager: PhaserAds.AdManager): void;
showAd(adType: AdType): void;
showAd(adType: AdType, containerId?: string): void;
loadBanner(size: GameDistributionBannerSize): GameDistributionBanner;
preloadAd(adType: PhaserAds.AdType): void;
destroyAd(): void;
hideAd(): void;
Expand Down Expand Up @@ -232,6 +251,7 @@ declare module PhaserAds {
destroyAd(...args: any[]): void;
hideAd(...args: any[]): void;
showAd(...args: any[]): void;
loadBanner?(...args: any[]): void;
}
}
}
139 changes: 109 additions & 30 deletions build/phaser-ads.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/phaser-ads.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions build/phaser-ads.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@azerion/phaser-ads",
"author": "Azerion",
"version": "2.3.1",
"version": "2.4.0",
"description": "A Phaser plugin for providing nice ads integration in your phaser.io game",
"contributors": [
{
Expand Down
4 changes: 4 additions & 0 deletions ts/AdManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ module PhaserAds {
this.provider.showAd.apply(this.provider, args);
}

public loadBanner(...args: any[]): any {
return this.provider.loadBanner.apply(this.provider, args);
}

public isRewardedAvailable(): boolean {
return this.provider.hasRewarded;
}
Expand Down

0 comments on commit f5265e4

Please sign in to comment.