Jump to content

Displaying adsense over the top of Pixi.js


0x54
 Share

Recommended Posts

Please forgive me for my lack of knowledge of Javascript or front end web in general!

 

I've got a Pixi.js game which reads the viewport width and height and sets itself to occupy the entire area. I now need to put an adsense ad over the top of the game. It would be a lot of effort to rescale the game so it no longer uses the whole viewport, as things like centering would be thrown off as a result. So if possible I would like to have the ad displayed over the top.

 

Is this possible? Can I give the adsense code an absolute position, on the far right? Here is an example of adsense embed code:

 

<script type="text/javascript">
    google_ad_client = "somenumberhere";
    google_ad_slot = "another-id";
    google_ad_width = 120;
    google_ad_height = 600;
</script>
<script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
 
There's also the asynchronous code type:
 
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
     style="display:inline-block;width:120px;height:600px"
     data-ad-client=some-id-here"
     data-ad-slot="another-id"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

 

 

All advice greatly appreciated!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...