Noncentz705's Recent Forum Activity

  • -- REMOVED --

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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"
  • sorry I hadn't realized. I made the plugin because I couldn't do what i wanted with ExecuteJs.

  • It's an input element with type='color' attribute. A Color chooser might be a better choice of words since color a picker is generally an analogy to grabbing a color from another source. At the moment there's no support for ie due to lack of implementation. There's a simple drawing example provided.

  • COLOR PICKER

    An input element with type=color attribute.

    Conditions :

    • On click
    • On change

    Actions :

    • Set Value (R,G,B)
    • Open

    Expressions :

    • getRGB
    • getHEX
    • R
    • G
    • B

    Plugin

    Example

    capx

    Be sure to check for support, as it's not widely supported yet

  • you could try using blendmodes https://dl.dropboxusercontent.com/u/139 ... dmode.capx

  • Create two bat files :

    File1.bat

    start C:\Users\%username%\Desktop\project_folder\File2.bat

    rem Notice I didn't use %cd%\File2.bat because preview runs from a temp folder;

    File2.bat

    echo CMD STARTED

    Now in your project back in construct

    • add the browser plugin to your project
    • create a variable named cd and set it's value to the path of your first bat file with \\ 's

    To launch cmd Browser Execute Javascript :

    "require('child_process').execFile('"&cd&"');"

    With that said there's probably a way easier way to do this

  • couldn't you just make a shortcut with the launch params you need or write a shell script?

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