grossd's Forum Posts

  • Hi,

    I just noticed that there exist a discrepancy between launching node-webkit in preview and when exported.

    In preview the following reference when injected as via the browser, throws a reference error, whereas when exporting it does not:

    var fs = require('fs');

    It would be great if both the preview and the export would equally load whatever library is needed to resolve the reference (node.js? perhaps).

    thank you,

    Dan

  • Hi Ashley,

    OK, so I solved it with some Javascript injected with the browser, and a tailored javascript call as follows:

    (Its pretty basic. It's too bad that its not supported "natively" in C2 in the node-webkit plugin, but since I am new to javascript, it took me a bit to stich together, and I feel my solution is rather brittle).

    In C2:

    set varCanvas = right(CanvasSnapshot,len(CanvasSnapshot)-23)

    Execute JavaScript varScript & "; me( 'c:\\results\\file99.jpg', '" & varCanvas & "');"

    and javascript I've loaded in the varScript variable:

    function me(name, canvas) {

    var fs = require('fs');

    var img = new Buffer(canvas, encoding='base64');

    fs.writeFile(name, img, function(err) {

    // if(err) {

    // document.write("<p>");

    // document.write(err);

    // document.write("</p>");

    // } else {

    // document.write("<p> The file was saved!</p>");

    // }

    //

    }

    );

    };

  • Ashley, any chance that node-webkit could support saving a canvas snapshot as an jpg or png -- or is this a limitation imposed by node-webkit itself.

  • I noticed that node-webkit save, saves a base64 string -- so I guess I would need to translate this back into a jpg image, somehow, from the outside.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I see. Thanks.

    I noticed that nodekit supports file save. Can it save CanvasSnapshot (non text files)?

  • Hi,

    I am trying to download a screenshot of the canvas. On the preview it works well, but when exported to nodekit I have problems.

    If i minify, instead of a download popup, I get a new "modal" window opened with the contents i want to download. The pop-up window doens't allow doing anything like ctrl-s for save or right mouse click for save as.

    If i don't minify, i get a pop-up window for a split of a second, that then disappears, removing the "goto" shows the captured image in the window "ontop" of the original window (i can see buttons the original window includes).

    all in all, its weird behavior,

    any suggestions would be much appreciated,

    Dan

  • Hi,

    While I am at it here another feature that would be very useful to support reuse with included event sheet.

    It would be great to have a reference object type that can point to object types. This would be like family, but instead would support referring to at most one element. A system action should allow setting the object type.

    For example, suppose I have included a Reference "plugin".

    In a main sheet one could then set: ReferenceCanvas = Canvas1

    In the included event sheet I could then use this in conditions and actions.

    Touch isTouching ReferenceCanvas ReferenceCanvas draw circle

    In another main sheet I could set ReferenceCanvas=Canvas2, and the include event sheet would also work with Canvas two.

    hope I explained that clearly.

    Dan

  • Hi,

    I am using the include event sheet quite a bit to reuse events across layouts. However, often the event sheet refers to Layout elements that should appear across layouts also. It would be great if there would also be an include layout option, which is, for example, included in one or more layers.

    And, perhaps a more "futuristic" feature:

    It would be great if an include sheet could support "Aspectual" weaving of elements. For example. In each event sheet where I include the "erase" even sheet, I need to add a "draw mode" condition to two already existing events. Best if within the include sheet I could specify, something like this: In Event-Sheet X, in Event #1, Even#2, add Condition "varDrawMode=1". The system would "weave" this addition into the main event-sheet.

    EDIT: in fact, there would like be three event sheets in action. 1) the main sheet, 2) a reusable event sheet and 3) a weaving event sheet. The weaving sheet would include the main sheet and the reusable sheet and add weaving instructions. The pattern is much like MVC (Model, View, Controller design pattern)-- making the main and reusable sheet oblivious of the reuse that is happening, and putting all reusable information into the weaving sheet (the weaving sheet acting like a controller as it were).

    This would make the code much more modular.

    Dan

  • Hi,

    I am using advanced text boxes to enter name and date information.

    I noticed that I can tab between the text boxes but, the behavior is slightly varied. On all but one text box tab immediate takes me to the next text box. On one I need to do tab twice to go to the next one.

    I wonder why that might be?

    thanks,

    Dan

  • (looks my response wasn't posted again)

    Many thank It works great (smoothly)and performs very well.

    Dan

  • (looks like follow up question, didn't get posted, due to an internet disconnect).

    How does one sample the location of input at 30 fps. I can see the each second event, which i could set at 1/30. But, how do i know where the current touch point is? Also any hints on how to average results would be great.

    Hmm, i would both sample at 30fps and draw at 30fps -- perhaps drawing should be less, say at 3pfs.

    many thanks,

    Dan

  • Hi,

    I am trying to use the Canvas plugin to draw with a stylus on screen (actually, I don't have a tablet (yet), and am using the mouse). Trouble is, I can't get it to work. Using draw point, you get a jitterly set of points, dependent on the processing speed of the event loop rather than a smooth line. Using draw line is complex since when does the user start or end touch of the canvas -- at least I haven't figured it out yet.

    Essentially I do: On Touch Canvas draw point Canvas.x, Canvas.y

    Any suggestions would be much appreciated.

    I need a way to smoothly and easily draw lines from one square to another. The squares are already drawn onto the Canvas.

    thank you,

    Dan

    p.s. BTW, I also tried the Plaster plugin, but using its quads to draw, I get the same jittery dots rather than a smooth line

  • sved,

    Sketchup, seems to do the trick. The library is very useful

    Thanks!

    Dan

  • Hello,

    I'd like to use everyday utensils in my game, like fork, spoon, chair, table. These have to be placed into the game in different perspectives. Seeing the fork as if one looks down on it, or while its placed on a table.

    Is there simple to use 3D software that one could recommend, where I could easily import or create everyday utensils and objects, and turn them around as I need, and then take 2D snapshots to include them in a game?

    many thanks,

    Dan

  • Thats great!

    Thanks. I'll study the game to see where i went wrong.

    Dan