Info

Statistics

  • Download count6,032 total downloads
  • Latest download count 1,533 downloads of latest version
  • Average download count3 downloads per day average

Owners

Description

Use 3rd party js libraries (including JQuery), call javascript functions, access object properties and methods. Implement game objects, and algorithms in javascript.

Example Files

Example demonstrates how to call javascript functions and use aliases to get/set object properties and call object methods. See full description on plugin's promo page: https://readymag.com/valerypopoff/valerypopoff-js-plugin/

Discussion

  • 21 Comments

  • Order by
Want to leave a comment? Login or Register an account!
  • Hola, puedes compartir algo de bluetooth?

  • Amazing plugin & thanks for the C2 port!

    I found a minor issue in the edittime.js file, which is causing C2 to complain when adding the plugin. In line 13 you've set "rotatable" to TRUE instead of FALSE.

  • I think I found a bug with the plugin. an alias with multiple variables overwrites if they are same. For example:

    var RectA = {

    left: 10,

    top: 10,

    right: 30,

    bottom: 30

    };

    var RectB = {

    left: 20,

    top: 20,

    right: 50,

    bottom: 50

    Setting alias RectA.left writes to both RectA and RectB. The only way to get around that is to use RectA.left1 RectB.left2

    • Ok, now I got this. This is not a bug. You're just using Aliases wrong.

      You initialized alias "RectA" with javascript "" (empty string). It means that alias "RectA" refers to nothing. The alias name is just a string. There's no way for the plugin to know that you meant javascript object named "RectA".

      So when you're later setting "RectA.left", you're actually setting "".left, which is just the global variable named "left". You also initialized alias "RectB" with an empty string. That's why RectB.left also means global variable named "left". Same variable. Actual javascript objects RectA, RectB and their properties stay unaltered.

      • Instead of

        Init ["RectA"] with javascript ""

        Init ["RectB"] with javascript ""

        Set ["RectA"] to 666

        You should do

        Init ["RectA"] with javascript "RectA"

        Init ["RectB"] with javascript "RectB"

        Set ["RectA"] to 666

        Load more comments (2 replies)
    • Can't reproduce the bug. Can you send me the sample project file with the bug?

  • Fixed the .c2addon file. Previously it wouldn't install the plugin when dragging and dropping the file in to the Construct 2 window.

  • I don't know if you read these, but adding this to a game prevents code minify from working. I've tested on 4 projects and all with the same effect. If the project references this addon, then minify fails, regardless of what code I add (if any).

    IT's a great tool, but breaks the code minification process.

  • Any suggestions?

    So I downloaded the valerypopoff-js-plugin to add to my C2 platform. And it won't take. I'll drag and drop into an event sheet, it'll say to restart C2, I do and the plugin doesn't appear in my "Add Event" window. I've dragged and dropped it into the C2>exporters>html5>plugins folder and when I open C2 it says unable to load the file.

    However, if I load the .capx sample from valerypopoff-js-plugin page, it shows the JS plugin in the "Add Event" window.

    I've tried also rebooting the computer after adding the plugin.

    I'm using the 0.7.1 plug-in. And C2 Release 279

    Any help would be appreciated

    Go figure. Any suggestions?

    • When you say "it'll say to restart C2, I do and the plugin doesn't appear in my "Add Event" window", do you mean that before trying to "Add event" you add an object of plugin's type to the project first? You do that, right?

  • thanks for this amazing plugin.

    one little problem is that when entering two js files seperated with ; the second js file is not included.

  • I can't open javascript or open javascript file editor, how do I write my javascript code, I have read your documentation but didn't provide a solution, I use construct 2 r277

    • "Writing" your javascript code isn't one of the plugin's functionalities. You use this plugin to include javascript files that are already written.

  • Can we see any tutorial to this plugin?