[PLUGIN] Clay.io (leaderboards & achievements)

From the Asset Store
Implement a customizable array-based achievement system with the fully-commented template.
  • That was it Wasn't sure what that did.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Its all working as expected now on mobile device using cocoonjs with the cocoonjs launcher app

    however i just compiled it in the cloud with cocoonjs, signed the apk etc, put it on my phone and none of the clay.io stuff works, login doesnt appear, scores not submitted, leaderboards not shown etc

    any idea what this could be? do we need to add something as whitelist url somehow?

    Ignore this, I think I forgot to add the additional files to the zip before uploading to cocoon, I'm recompiling now so will let you know if I still have problems when it's done

  • austin

    I'm sorry but i'm going to have to end up adding a third post to this form.

    I fixed the first problem i was having but now i have another.

    The log in and leader boards are EXTREMELY large. I cant figure out how to make these windows smaller because they are unnecessarily big on the iPhone 5. When i try them in Google Chrome they function properly (normal size)

    How do i fix this problem?

    On a side note, i'm having a little trouble correctly displaying the users name in a text field. It works sometimes, but often it changes to "" (nothing) or "Anonymous".

    I got around this large UI issue using the custom css, login in to clay.io and go to the settings for your app, scroll down to the bottom and set the custom framed css to something like this:

    body{font-size: 0.5em;}

    #clay-login form .form-row label




    #clay-login form .form-row input[type=text], #clay-login form .form-row input[type=password]




    #clay .instructions {width:100%;}

    and set the unframed css to something like this:


         .clay #clay-leaderboard-wrapper table tr td, #clay #clay-leaderboard-wrapper table tr td {



    you only need the unframed one for stuff like the leaderboard

    this css will resize things down and use a more dyanmic approach to sizing the elements, please note i havent gone as far as making changes to the create account form, but if you use Chrome's element inspector you will be able to see the names of the rest of the css elements you will need to change

  • austin

    Wow, thank you so much!

    The sizing issue was fixed due to the changes you made on your end. (though i still think it seems larger than intended, but that could just be the way you want clay.io to be seen. There is still a scroll arrow option that is visible when the log in appears and this is a common sign of the fonts and images being to large)


    Thanks for your input and showing me how you overcame the issue, i would love to explore the different options in the CSS but i actually have no idea on how i can go about changing them, for the main platform i am developing for is IOS iPhone.

  • Salvo776 is it back completely to normal now? Unfortunately that scroll will probably still be there though.

  • austin Yes it better now, thank you. I'm currently implementing my own leader boards table now. If i in counter any problems ill be sure to ask you for advise. You help out a lot on this form and i'm very impressed by your work you've put in technically, and socially.

  • With the new beta release supporting BB10 export I was wondering will Clay.io work with this? I dont have a BB10 device to test with

    Im just thinking that with the cocoonjs builds we need to add those additional files to the zip before uploading to cocoonjs, do we have to use the same approach somehow with the bb10 builds?

    I will spend some time tomorrow to see if i can get hold of a bb10 simulator and see what we can do, but any info you have austin would be great

  • austin: Is there a way to get the name of the current leaderboard? I can only find the fetchedleaderboardID in the plugin's expression.

  • theames - I think I recall someone saying it did work with BB10, but you'll have to see for yourself as I don't have anything to test it with :)

    tipztv - nope, not sure that's something worth doing either since you could just manually map the leaderboard ID to the name, no?

  • Okay, will try out your suggestions.

    Can you make a separate log in window for Windows Phone 8? It works okay, but the facebook, google, linked in do nothing other than bugging the game with a blank screen when they are clicked. If possible, can you remove those buttons?


  • austin: Previously, I have been using an older version of the plugin for the game. Yesterday, I upgraded to the latest one and the game takes really long to display the content. What happened? Any change log?

    Usually, it takes 3 seconds to load the game, now, it takes more than 10 seconds or more to display the splash screen, which does not have any Clay.io event.

    I found Clay.io is the problem because I have removed the plugin, and the game loads fast as usual.

    On the computer, I can load the game like usual. The log-in window appears right away. But on the phone, it usually takes 10 seconds longer to load all the elements of the log-in box. This does not happen before, with the older plugin. I'm using the same wi-fi network, so the network is not the problem.

    In addition, I notice the log-in box on the PC version is different than the one on the phone. I have updated all the Clay.io js files to the latest one.

    Any suggestions?

  • tipztv are you still having that issue? Nothing was changed that would have caused that, but I'm starting to do a changelog in the plugin from now on.

    Also made a change that should hide the social login options from WP8, but don't have a means to test it, so can you let me know if that hides them for you?

  • austin: I'm still having the problem. Is the game supposed to load all the plug-ins before it displays the content? When I run the performance analysis in Visual Studio, the game actually starts under 1 second (0.77 second), but it takes 5 ~ 10 seconds to display the splash screen.

    I unchecked the social options in the Clay.io settings page so those buttons are gone now. The Create Clay.io account link is still there though, which does nothing when clicked.

    What about the log-in box problem? The mobile version is different from the pc version? I see three tabs on the pc version, but the old box still appears on mobile.

  • After updating to the latest version of C2, I am getting this error:

    Javascript error!

    TypeError: Clay.Player is undefined

    localhost/Clay_plugin.js, line 1156 (col undefined)

    I re downloaded the plugin just in case, but the error remains. :(

  • tipztv I may not have included the most recent clay.js and api.css in the plugin folder. Updated it, maybe that will solve things? Which splash screen are you talking about? Unless it's the custom loader I put in, Clay.io shouldn't affect the loading of the game itself.

    Snooba - are you trying to call any specific functions before Clay.io is ready (a separate condition)? This might happen if you try calling the player login before the plugin has loaded (player login is actually called at the beginning if the player is logged out regardless)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)