Nepeo's Recent Forum Activity

  • Ah yeah so the first link is the manual for Construct 2. Because it's been around for quite awhile it often appears high on Google searches and the like. Quite a bit of the manual content is similar for C2, but for C3 you want the C3 manual which is on Construct.net not Scirra.com.

    That second link is a guide made by a user for C2, I have no idea if it works or not. But things have changed a lot.

    Unfortunately for any software product that has been around for long enough, and changed during that time, it's inevitable that you will end up with outdated tutorials around on the net. There's not much we can do about it.

  • Might be worth checking if you actually have enough space to save the file to your cloud storage?

  • The build service will validate that icons are the size their names suggest, as cordova will fail with a cryptic message if the size is wrong.

  • opengameart.org has quite a wide range of assets, not all of it is amazing though so it can take a while to find what you want.

    I quite like Kenney assets, tend to be very high quality and they have a wide range of content. I'm not sure if they have anything that counts as "sci-fi" though. kenney.nl/assets

  • pjdegrieck could you link me to the tutorials you were using?

  • Your script

    MyFunctionInsideTheConstruct3Canvas = function() {
    	alert('Works!');
    }
    

    Is a declaration in the global scope of the iframe. The global scope is unrelated to the canvas, which is why you cannot access the declaration.

    Looking at some of the labels here I think it's worth going over some definitions:

    • HTML element: a component of a document, there's lots of types and they in turn can contain other HTML elements. examples include images, iframes, canvas, text and buttons.
    • document: a collection of HTML elements, a browser tab shows 1 document.
    • iframe: a type of HTML element that can contain a document, allowing to place a document within a document.
    • canvas: a type of HTML element which is similar to an image, but has various methods that allow you to modify the contents of the image.
    • variable: (JavaScript) a container for a value
    • function: (JavaScript) a unit of code that can be run repeatedly, by another piece of code
    • scope: (JavaScript) an area in which variables and functions are declared
    • nested scope: (JavaScript) a scope, within another scope. it can see the contents of all the parent scopes, but the parent scopes cannot see the contents of a child scope.
    • global scope: (JavaScript) the root scope for a JavaScript context. Each document has a different JavaScript context, and therefore global scope.

    So let's break down what the world looks like to your code. You have 2 documents; the first contains an iframe, and the second contains a canvas. Let's call them A and B. Document A is the one that contains the iframe, and document B has been loaded into the iframe.

    You have the following code in document B

    function mynestedfunction () {
    	alert('Works!');
    }
    

    which has declared a variable in the global scope of document B, and placed a function into that variable.

    Document A has a piece of code that wants to get that function from document B and call it. First it needs to get hold of a reference to the iframe, by searching it's document for the iframe.

    // get a list of all the iframes in my document, then take the first one and place it into a variable
    var iframe = document.getElementsByTagName("iframe")[0];
    

    Now that we have the iframe we want to get the global scope of document B, which is available in the contentWindow property of the iframe, and then get the variable from it.

    // get the "Window" of the iframe, this is the global scope of it's document
    var iframe_scope = iframe.contentWindow;
    // get the function by it's name from scope
    var iframe_scope_function = iframe_scope.mynestedfunction;
    // call the function
    iframe_scope_function()
    

    There's a few interesting things to note here. Firstly if you aren't in a nested scope, any variables you declare will be in the global scope. Secondly the global scope is special in that it's contents can be read from the variable "window", you cannot do this with normal scopes. Thirdly window is declared in the global scope, so you can do silly things like window.window.window === window. Finally there is an alias to the window object called "globalThis", the reasons for using this are kinda complicated, but all you need to care is that it will give you the same value as "window".

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm guessing your asking for Construct 3? Sometimes we get people asking questions about Construct 2 on the Construct 3 forums.

    .capx is the format for Construct 2 projects. Construct 3 uses .c3p instead. C3 is capable of reading .capx projects for backwards compatibility but it isn't possible to save as a .capx with C3.

    There is a guide on saving files with C3 here.

  • It's technically possible, but a lot of work. We would need to research the Android APIs further, look into similar iOS ones. Once that is done we would have to write a new cordova plugin to access the native methods, then either integrate it with an existing C3 plugin or add a new one.

    If there was more interest we would look into it, but I don't think there is. I talked to one guy a couple years back who wanted to make a game for the visually impaired using vibration but that was the last time I remember someone mentioning it.

    You can file a feature request on https://construct3.ideas.aha.io/ideas?project=C3 and we'll take a look at it once it has gained sufficient interest. Or try asking around of the SDK forum, might be that a developer will make a 3rd party plugin for you.

  • Are you using the test advert unit ID's or are you using your own with test mode enabled? We generally suggest to do the latter, as the test unit ID's can give false positives about your your configuration being correct. Test mode actually verifies your unit ID's.

    No idea what the 200 partners thing is about. Might be a side effect of using test ID's or that of the 900 providers only 200 are partners they share data with.

  • The dialog that appears to ask for user consent is provided by Admob, and for awhile it could only display up to 12 providers. If you had more than 12 it would break, and your adverts wouldn't show. They removed the limit in one of the updates, but we didn't notice. 199 might be the number of providers in the list which you can pick from, I know there's a lot.

  • The API we use only provides the capability of producing a vibration pattern ( for example: vibrate for 200ms, pause for 100ms, vibrate for 300ms, pause for 50ms, vibrate for 50ms ). It doesn't allow you any other control unfortunately.

    The actual native APIs on devices tend to be rather fragmented. Originally on iOS and Android vibration was actually part of the audio system. Now they have dedicated systems for it, but some cheaper hardware isn't capable of meeting the requirements for more advanced things.

Nepeo's avatar

Nepeo

Member since 8 Mar, 2016

Twitter
Nepeo has 583,792 followers

Trophy Case

  • 8-Year Club
  • x4
    Coach One of your tutorials has over 1,000 readers
  • x3
    Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

13/44
How to earn trophies

Blogs