Noncentz705's Forum Posts

  • 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)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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]
  • 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.

  • -- REMOVED --

  • I unno, I had the test folder and text file created ahead of time. Dump your response text to a text object so you know you got it. After saving to disk with AJAX.lastdata the file contents aren't changed?

  • Sorry I couldn't answer sooner. The first part is just a server script for node js to test with you can ignore it ;

    In short what it's doing - > is reading a file and then starting a new server instance. Any incoming requests with url '/route' are served the file with content type plain text else a 404 notice.

    Do the same thing in php or w.e else and it should work? Good luck, hope you figure it out.

  • You're missing a '}'

    myFunction(){
      return{ 'prop' : 'some_value'};
    }
    [/code:2g36nqw8]
    [code:2g36nqw8]Browser.ExecJS("window['myFunction']()['prop']")[/code:2g36nqw8]
    
    One other thing, don't forget to change your variable to 'text'
  • On some_event set some_var

    Browser.ExecJS("window['obj_name']['prop']")[/code:1v0d8p4t]
    Where you've defined [code:1v0d8p4t]obj_name = {'prop':'Some text'}[/code:1v0d8p4t] globally;
    
    Then if you need to fetch some_var from your script;
    you can look for them in c2canvas.c2runtime.all_global_vars 
    [code:1v0d8p4t][{'name':'VariableName','data':'Value' .... }, { ... }];[/code:1v0d8p4t]
  • Worked for me, can you send the file you want to download out as text?

    Node

    var fs = require('fs'), 
           http = require('http'), 
           path = require('path'), 
           ct = {'Content-Type:':'text/plain'},
    
    //The file to send
          file = fs.readFileSync(path.resolve('.\\DOCS\\','doc.txt'));
    	
    http.createServer(function (req, res) {switch(req.url.toLowerCase()){
      	case '/route': res.writeHead(200,ct); res.end(file.toString()); break;
      	default : res.writeHead(404,ct); res.end("404"); break;
    }}).listen(1337);
    [/code:3axab91t]
    
    Construct
    
    On start of layout : Ajax Request "http:// ... url/route" - "tag 'M'"
    On "M" complete Node-Webkit Write Ajax.lastdata to file "C:\test\filename.txt"