How do I get function from the console to use it in C3?

0 favourites
  • 4 posts
From the Asset Store
Small pixel icons for the 3 most popular controller types.
  • Hi, i'm preparing project for the platform and adding their SDK with ads.

    I'm working with the C2 runtime and features of the c3 runtime are not available for me with this project.

    The thing i can't handle is to get function from their api.

    The question is : How to get this function that happens in the Console and then to run action inside Construct?

    For example:

    ->From the Construct i'm Executing JS with the function 'showAds'

    -> then ads is showing

    - > after the ads Complete i can see the function 'adsComplete' in the Console

    -> then i need to run the action in the Construct, after this^ function.

    As i know it can be done from the index.html with c2_callFunction, but i don't know the coding.

    I'm hoping anyone know the solution!

    Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah, you need to find the function 'adsComplete' in the parent html or in the lib you are using, and insert this code into it:

    c2_callFunction("OnAdsComplete", []);
    

    Then create "OnAdsComplete" function in the event sheet.

  • Thanks! But it it possible to write this function in the index HTML? Since main sdk file is downloading from server, i don't have such file in my folders.

  • You need to check SDK documentation, maybe they provide some API. If this SDK is a single JS file, you can also try downloading it and including into your project, then you should be able to insert your function call.

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