Noncentz705's Recent Forum Activity

    • First part about getting and setting variables.
    • Setting variable example :

      On some event Execute javascript "(function(){window.foo = 'something'})()"[/code:wl21003j]
    • Getting variable example :

      On some event set text to Execute Javascript "(function(){return window.foo;})()"[/code:wl21003j]

    Then about the callFunc part it maybe the picture will explain better ...

    > [attachment=0:wl21003j][/attachment:wl21003j]

  • Joannesalfa , it's not code for a plugin but instead something you would add to the page your game sits on to trigger c2 functions. A quick example :

    • Make a c2 project that has a function named 'callback'
    • After exporting the project, add the js from above to index.html, and then you can call the 'callback' with callFunc('callback')

    However it sounds like you're trying to do the opposite and update an element of the page your game sits on from c2;

    If that's the case then you don't need the code, just use the browser object and execute js.

    Example :

    ...  <p id='my_tag'>{{PlaceHolder}}</p> ....[/code:3u6olnub]
    Browser Execute JavaScript "my_tag.innerHTML = 'New Content'"
  • Are you trying to call a c2 function from the page your game is embedded on?

    -- REMOVED --
    [/code:1qbwhd75]
    [ul]
    [li]0 : Function Name ('String')[/li]
    [li]1 : Function Arguments ('Array' & 'Optional')[/li]
    [li]2 : Function Object Name ('String' & 'Optional') -> usually 'Function' unless renamed[/li]
    [li]3 : Frame Object ('Object' & 'Optional') -> if you embed your game pass a reference to the iframe[/li][/ul]
    
    -Add Function object to your project and add a new Function ... i.e : 'callback'; 
    then call it from the page with callFunc('callback');
  • GameThirsty if it's just the appearance of input that bugs you, maybe give it an opacity of zero with css and place a sprite on top of it.

  • Sorry you're right but there was a time where you couldn't.

    It seems most browsers have updated to allow it. It still may be blocked as a popup though, at least that's the case with Firefox.

  • Global text prev = ''
    FileChooser on changed 
        -  prev != ""          FileChooser release file prev
        -  Trigger Once   Set prev to filechooser.fileurlat(0)
                                     Sprite load from image prev   
    [/code:94nqo0u0]
  • You can't trigger a click event on a file input due to some implementation b.s but if you're exporting to node-webkit it's possible. Give the filechooser an id ('i.e file_chooser) in the properties bar and add the browser object to your project

    On some event

    Browser Execute javascript "file_chooser.click()"

  • You could try parsing the json with the browser object. For example,

    System set some_variable to

    Browser.ExecJS("(function(){var obj = {""url"":""some_link"", ""other"":""something_else""} return obj.url})();")

  • edit:

    Here's a capx similar to the timer in your picture ; It uses blend modes, hope it helps.

    Demo

    Download (new)

  • or if you meant without the borders ('frame-less')

    Before export: ...make edits to exporters\html5\node-webkit\package.json

    "window": { ....
     ,"frame": false
    }
    [/code:4wpwlpks]
    [b]OR[/b]
    
    After export : 
    windows or linux : package.json is inside [i]package.nw[/i] (it's a zip file)
    mac : ... [i]osx\newproject.app\Contents\Resources\app.nw\package.json[/i]
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The way I've done it is snapshot to canvas then load the snapshot into a temp canvas then use.

    tempcanvas.getImageData(x,y,1,1).data

    Problem then becomes having the temp canvas matching the scaling / size & alignment of the c2 canvas otherwise the coordinates aren't accurate.

  • Because somefile.bat launches in the background; Where it's not apparent whether or not the script even ran and the double bat trick doesn't work for me otherwise.

Noncentz705's avatar

Noncentz705

Member since 28 Apr, 2013

None one is following Noncentz705 yet!

Trophy Case

  • 11-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

13/44
How to earn trophies