lemo's Recent Forum Activity

  • Ashley

    Alright fair enough, hopefully we can see these new binary methods later in C2

    I found another thing to keep you busy with nw.js though

    I think MadSpy you have the greenlight to release your plugin now ; )

  • A "cancel" event listener is coming in the next version of nw.js, according to the link below

    Ashley could we have this "on cancel" next to the other "file dialog ok" events?

    This would definitely save me a few headaches for later :]

    https://github.com/nwjs/nw.js/issues/4501

  • Looks really good, I like how you went into the detail with the slight background textures and animations

    I didn't have any plan to make a theme, but maybe I'll spend some time on one later

    How did you make this neat color picker btw?

    For suggestions, maybe you could optimize the preview event sheet to show even more types of elements

    Or you could either make the window bigger or just have a scroll bar to show more events

    Would be perfect if you could click anywhere on the preview and be directed to the matching color option

    PS: Maybe you should move this to the Tools/Resources forum

  • Looks like this adds one second or two of additional loading time,

    and also seems to trigger antivirus false alarms (in compressed mode)

    Personally I think I'll use an installer instead

  • I agree it would be nice to have the option directly in C2 when exporting

  • Ashley

    Okay yeah I hear you about the intermediate/middle man process

    Looks like it would take a while to develop such mechanics though, and maybe it will happen only for C3

    In the meantime there's no built-in function in C2 to save image screenshots on desktops, and people might still prefer a "slow function" than none at all

    See just yesterday, apparently this guy made his first post on the forums just to ask about this feature (is conversion speed even relevant for a few screenshots?)

    All that's needed is an extra switch in the plugin code, to have the choice in writeFileSync() from {"encoding": "utf8"}, to {"encoding": "base64"} or {"encoding": "binary"}

    So I wouldn't say you "continue to build on them" but rather provide an instant fix/adjustment to have a feature otherwise impossible for the moment

    (*possible now but even more bloated through the use of a custom EjecJS expression)

  • Thanks for the reply Ashley

    Can you guys explain what you mean by a "true" binary image (or a fake one)?

    With the method above in the end we seem to get a proper binary PNG file, and very different from it's base64 string counterpart

    Also, either using {'encoding': 'base64'} or atob() and {'encoding': 'binary'} seems to produce the same result

    Can you see the capx below, and explain how the resulting PNG isn't a true binary one?

    NWimagefile.capx

    Otherwise yeah I suppose it would be more efficient to remove the "base64" middle man from the CanvasSnapshot method (or extract base64 plugin),

    and somehow access the binary image data from a layer or a sprite for the user with say Sprite.imageData, and be able to save it directly ^^

    PS: MadSpy I posted a couple of links on page1 with (apparently?) buffer examples

  • I see, sounds pretty good then

    Either way Ashley there's still time to consider such a MINOR change for a very HANDY feature in the official plugin.

    I mean, proper games do have a hotkey to save their captures as images in a Screenshots folder... and the file I/O actions are a major reason for people to use nwjs

    PS: In my case of sprite extract and image library, being able to save/load PNGs on disk (currently with the execJS action) instead of TXT images boosted my loading times from 7sec to now just 3sec

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Okay sounds alright

    Btw in case of a separate action from the other Write File, maybe no need to have the utf8/base64, and just keep base64 for this one

    Probably best to have a png/jpg dropdown in that case actually

    How would you plan to implement an extra action to the official plugin like in your pic though, keeping this post in mind?

  • Yeah I guessed it would from the pics, I was just nitpicking about the naming of "Write Canvas Screenshot" instead of something more general

  • MadSpy Yes, that's pretty much it, or rather for the name just "Write Image" or "write File +"

    So people could save other things rather than only CanvasSnapshot

    In my case, like I mentioned above I save a bunch of Sprites though the base64 extract plugin

    "var fs = require('fs');fs['writeFileSync']('" & replace(replace(AppPath & "Img\" & replace(Box.Title,":", "~") & " (" & Box.Year & ").png","\","\\"),"'","\'") & "','" & Box.ExtractImage.currentImage & "'.split(',')[1], {'encoding': 'base64'});"[/code:sawspujv]
    
    But yeah my execJS looks like above, would be much cleaner with a proper C2 action... does it mean you are making the plugin?
    If you are, it would be great to have the synchronous/asynchronous dropdown as well :]
  • MadSpy Thanks that also works, and even better than my version as I don't have to call the nw.js plugin and keep a modified version of it with "binary" encoding mode :]

    It's pretty much like in the first link I posted on this thread, but I had no idea you could use nw.js functions in execjs too so, it's good to know

    Looks like the "base64" encoding choice does the conversion directly, also saving a step which is nice (so let's says Encoding dropdown: Utf-8 | Base64 | BInary for my suggestion above!)

    Although this is good for temporary work around, I rather not have a capx that looks like a full JS script, and hopefully we can have more "C2-friendly" options in the actual NWJS plugin

lemo's avatar

lemo

Member since 17 Dec, 2012

None one is following lemo yet!

Trophy Case

  • 12-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

14/44
How to earn trophies