JohnnySheffield's Recent Forum Activity

  • Unfortunately, nope, you can't get the "real" fs (and any other node stuff) inside a normal chrome browser.

    The magic of node-webkit is in the combination of node.js, and chromium browser (former webkit, currently blink), hence the node-webkit. check the git project hosted on github for more info on nodewebkit.

    You could check out the awesome browserify-fs project (https://github.com/mafintosh/browserify-fs) it has the "fs" module implementation for chrome, but it does not give you access to the whole system, it just emulates "fs" inside leveldb so you cannot read some file on c:/documents/whatever , it just stores a file inside local storage. (but you can store a pdf using browserify-fs, or a .doc, or a .capx file, if you're into it)

    I didnt use the browserify-fs project yet, so you're on your own there, but it might be useful, depending on your requirements.

    edit: looks like browserify doesent support fs check out: www.browserify.org

  • Yes, fs stands for filesystem, it is an implementation from nodejs's fs module, you can read more about it here:

    http://nodejs.org/api/fs.html

    the require function comes with node, read more about it here:

    http://nodejs.org/api/modules.html

    Are you previewing your project in nodewebkit? because fs (and require and node stuff) is not available inside the browser!

  • Hey man, link doesn't work (access denied)

    edit: All good now

    looks great, what's your layout size?

  • I'm interested. Do you have any ETA on plugin release?

  • paulh Pode

    I've ported jsPDF to C2. I would be soo happy if you could download, test and give feedback.

    topic here

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • JsPDF

    Generate PDF files in client-side JavaScript.

    I've exposed jsPDF to C2 users, you can find more info here

    Let's you create multiple pdfs with different sizes and orientations containing multiple pages. Please test if it's possible on multiple platforms and send feedback. Initial test are ok on Chrome, Firefox and Node-Webkit .

    After feedback from the forum users and hopefully some improvements, i'll push this to Git for everybody to use .

    API

    Actions

    Set Font Size (size)

    Add text (X,Y,Angle,String)

    Add Image (X,Y,width,height,DataUri Type, DataUri string )

    Draw a line (x1,y1,x2,y2)

    Draw a rectangle (X,Y,width,height, style)

    Draw an ellipse (X,Y,rx,ry,style)

    Set text font (font name, font size)

    Save pdf (filename)

    Add page

    Set properties (title,subject,author,keywords,creator)

    Set text color (r,g,b)

    Set stroke color (r,g,b)

    Set fill color (r,g,b)

    New (orientation, unit, format)

    Expressions

    Pdf as DataURL

    plugin

    html test

    pdf_test.capx

    Changelog 03.07.2014:

    Upped plugin version to 1.1

    Updated jsPDF libray to 1.0.178

    Added support for PNG, JPG and JPEG DataURI types,

    Two new formats available; d1, credit-card

    Changelog 13.07.2014:

    Upped plugin version to 1.2

    Draw ellipse implemented

    Set text colour implemented

    Set fill colour implemented

    Set stroke colour implemented

    Added style parameter when drawing objects (Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke)

    Changelog 05.1.2014:

    Minification support thanks to

    Plugin is now available on the repo (search for the "download zip" to download plugin)

  • Try not to store data in global variables, as their name will be visible in the minified code.

    You can store your data in instance variable of a object (eg. an invisible global sprite). Instance variable names are changed during build, global variable names are not.

    So, if you have global variable named "score", in your minified code you can search for that variable name.

    If an object has a instance variable name called "score" (eg. "sprite.score"), it's name in the minified code will be something like "g.ba", so it'll be harder to find.

    Also, you'll obviously need to improve your security more, you should never trust the client for any data it sends to you, global variable visible or not.

  • hey, limonspace.

    I really don't like the "hold mouse button to fly" approach. Enable some keyboard controls.

    Also, i see you're using one of the "unstable" versions of socket.io plugin, and i strongly recommend against using it for anything else but testing and playing around.

  • Maybe you can use the RegexSearch expressio to search for a single qoute?

  • I don't think this is stupid effect at all.

    You provided a great way to enable colorblind people enjoy c2 games much easier.

    <img src="smileys/smiley32.gif" border="0" align="middle" />

  • I've just encountered this yesterday, i use the "Tilemap.x+Tilemap.width/2" so things don't break if i change size of the tilemap.

  • Fimbul

    Well, you actually kinda have the node.js exporter, thanks to the great guys at node-webkit. Nothing stops you to create a C2 written nw app, that runs in background and acts as a server. Just ignore the webkit part of nw, and use just node.js part. Put that on a pc with a public ip and you're done.

    It's not the usual way someone would host and run node.js servers, and i don't recommend to do that, but hey, you can write a fully pledged http (or udp or tcp or etc) server in C2, it just comes with a backpack filled with webkit.

    Also, i'm kinda amused with this all fuss about multiplayer coming to C2. It's already here; there are 2 official and about 5-6 unofficial plugins for about a year now (or more?) for creating different kinds of C2 multiplayer games. They are just not called "Multiplayer" and one has to be resourceful in using them.

    I'm really glad when anything gets official support in C2, so cheers to Scirra on this announcement.

    WebRTC!

JohnnySheffield's avatar

JohnnySheffield

Member since 31 Jul, 2012

Twitter
JohnnySheffield has 1 followers

Trophy Case

  • 12-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

15/44
How to earn trophies