[PLUGIN] c2i - canvas/base64/screenshot to image

0 favourites
From the Asset Store
The I18N (Translation) is a Construct plugin created to translate text in game.
  • I have tested it with the same chrome release - it works as expected. (Win Xp, canvas2d in Chrome). What happens when you save the image and load it with Paint or similar?

  • Bingo, my Chrome was running on WebGL, forcing the project to use canvas2D in the Project Properties fixed the issue.

    I'm not sure how to change it in Chrome itself, because your example page still isn't working for me, but my example is now.

  • I've searched now for "chrome empty images" and found that this "problem" with empty images isn't unknown. (Seems that there can be troubles with chaching images when often reloading the same page/image/.. )

    [Edit]After a few tests I have the following:

    for Chrome 18.0.1025.142 m (+19.0.1084.9 dev-m):

    -) WebGL - only Sprite saving works - having the same issue as above

    -) canvas2d - all actions work

    Firefox 11.0:

    -) WebGL - all actions work

    -) canvas2d - all actions work


    I'll try to update the plugin for the chrome WebGL-renderer - asap.

  • allright, i'm happy you could reproduce this error.

    I haven't said how awesome this plugin is yet, this is gonna open a new door for app-development in C2, things like online image editors & much more !

    great work !!

  • Fantastic! Just what I needed!

    I will experiment a bit with this GREAT plugin

    Well Done once again for the FANTASTIC work

  • Wishy: Thanks for reporting this bug so clearly. I'm working on the WebGL support- but currently I have no plan how to convince a WebGL-Chrome to save a canvas as an (not-empty) image. I've tried different ways for the WebGL and had success - problem is - only for Firefox and that is working already. <img src="smileys/smiley2.gif" border="0" align="middle" />

  • Joe7 Allright, looking forward for a fix :-)

    keep up the good work, here's something i'm working on with this plugin:

    Subscribe to Construct videos now

    Another small addition, when testing on my Android device, it also resulted in a white exported png :s

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Updated to v 1.4: WebGL hopefully fixed

    Next step: Support for mobile devices.. <img src="smileys/smiley2.gif" border="0" align="middle" />

    [Edit]Seems that Canvas.toDataURL is broken for Android (2.x)-devices - code.google.com/p/android/issues/detail

    I suppose this causes the blank images. I've tried to implement a workaround for them (http://code.google.com/p/todataurl-png-js/) but the translationtime for the saving is much too long - I think waiting for a good Webkit-Androidimplementation makes more sense - or anybody knows a better way..

    Wishy: Awesome App. On desktop-browsers the saving should work. <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Thanks for the update Joe7,

    Text isn't saving on the exported image in WebGL though, it does in Canvas.


  • Getting this error

    <img src="http://dl.dropbox.com/u/53012532/c2iError.png" border="0" />

  • aridale you must copy the canvas2Image.png to your project folder, had the same issue

    Joe7 when trying to export big files like this one, the saving process hangs and the error console gives this error:

    Error: uncaught exception: [Exception... "Security error" code: "1000" nsresult: "0x805303e8 (NS_ERROR_DOM_SECURITY_ERR)" location: "http://ohrly.net/meme/c2runtime.js Line: 8159"]

  • ok... what png? there isnt one in the zip.

    Have you tested the new version? Even your example page doesnt work all I get no matter what I push is the normal sized shield img and in my own program the On Saving Complete is never getting called its not even attempting to save my img

  • aridale: Sorry, have forgotten it - I did't thought on that.

    It complains about the missing image that gets drawn on the canvas of the plugin.

    copy the following image in the export folder or replace it with an own (in C2 open the 'image-loading-dialog')


    Wishy: I haven't implemented anything about jpg - hope that causes the error and that it's not a browser-"timeout"-error or something similar.. <img src="smileys/smiley2.gif" border="0" align="middle">

    Wishy -Textsaving: Yes, I recognized that with the "Text"-object too. Is this a problem? I suppose C2 handles the Text-object a little different when using canvas2d or WebGL renderer - or this comes perhaps directly from the renderer.. (I haven't implemented anything for the renderering of text in the plugin.)

  • History - c2i:

    [Update3] c2i - v 1.3:

    1) The php-file 'createImg.php' gets now created from C2 when exporting the project.

    2) Demo - changed: The demo-project is forced via the project-properties to use the canvas2d renderer. --> should work now properly on whatever.

    [= current workaround to avoid the WebGL-bug - see posts on side 2]

    3) Refactored plugin-sourcecode - no improvements to recognize during edittime but the plugin has now fewer codelines and works as the last release.

    Demo - canvas/sprite/screenshot + Plugin(v 1.3)+capx


    [Update2] c2i - v 1.2:

    Screenshots are possible now

    Demo - canvas/sprite/screenshot + Plugin(v 1.2)+capx(WebGL renderer - if possible)

    Known bug: WebKit+WebGL:

    If WebKit-Browsers(Chrome) are forced with the setting in the project-properties to use the WebGL-renderer they create only blank images. Firefox has no problem with WebGL enabled.

    Workaround for now: Use the "canvas2d" renderer. This should work on whatever..



    [Update] c2i - v 1.1:

    Now the saving of Base64-Strings to images is possible. Together with Pode's behavior "Extract Sprite to base64 string" it's possible to save sprites to images.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)