[PLUGIN] Canvas

2 favourites
From the Asset Store
Pixel Destruction like in "Worms" (Drawing Canvas based)
  • newt

    Textures would be useful but I have to work out a clean way to reference them in expressions.

    Animmaniac

    You can do what you describe with effects.

    For example use the "Destination out" effect to subtract alpha:

    http://dl.dropbox.com/u/5426011/examples%208/canvasTrail.capx

  • Sorry to keep begging for stuff, but I was wondering if it would be possible to have the canvas export an image?

  • I would really like to export the canvas to a image aswell! <img src="smileys/smiley1.gif" border="0" align="middle" />

  • The plugin has the expression "imageUrl" which stores the entire contents of the canvas as a png in base64 which you can copy paste into another browser window to view. You should be able to use the string returned by imageUrl with the plugin "load image from url" but saving the file to some server space is beyond my knowledge as I haven't dabbled with that aspect of the internet yet.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What about allowing the user to save those contents , like right click save as, or click an object, open a save dialog?

    I know the regular context menu is disabled, so the latter would probably be best.

  • What about allowing the user to save those contents , like right click save as, or click an object, open a save dialog?

    I know the regular context menu is disabled, so the latter would probably be best.

    There is tutorial about saving the canvas image,(not Construct)

    HERE

  • Not 100% sure but I think there may be a bug with the getImageUrl expression.

    Return in a text object returned nothing, but using the browser object, open url in a new window returned what I'm guessing is a base 64 string.

    Also would I safe in assuming that method would allow me to do my previous request of being able to save a modified canvas?

  • If you double the height of the Text object you will see the text. It seems that if a word is wider than the text object then it is sent to the next line.

    I can only find a IE solution to provide a save as dialog to save the image. For now using the browser object to open ImageUrl and right-clicking save as is the simplest way that comes to mind.

  • If you double the height of the Text object you will see the text. It seems that if a word is wider than the text object then it is sent to the next line.

    I can only find a IE solution to provide a save as dialog to save the image. For now using the browser object to open ImageUrl and right-clicking save as is the simplest way that comes to mind.

    Oddly enough, it doesn't work in IE, but does in FF, and Chrome.

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

    Image url that is.

  • If anyone is wanting to change SVG to canvas, use this to get coordinates etc professorcloud.com/svg-to-canvas

    saves a bucket of time!

  • In C2, what is the best way to display a resizable rectangle? With this plugin?

    Or just make a square sprite and change its dimensions?

    Or is it about the same in terms of memory/speed for a 1-50 instances?

    One thing I want to do is make a view-port rectangle in a minimap.

    (A one-pixel un-filled rectangle would work. Or I could draw a rectangular sprite, resized on the fly, to represent the same thing.)

    Thanks

  • Right now, I'm using a plain sprite rectangle to indicate the viewport on the minimap, resizing depending on zoom level.

    But I'm also curious about whether 'drawing' a lot of enemies, bullets, missiles, etc, is better than using pixel sprites instead.

  • The Canvas plugin does not use webgl so I would say that using sprites is faster.   Also sprites would use less memory since multiple instances share the same image, whereas the canvas has a separate image per instance.

    If you have webgl disabled you may get better performance by using one canvas and drawing rectangles to that, but you would have to do tests to see if that indeed is the case.

  • Thanks very much for the reply. Appreciate it!

  • Is it possible to change color of some part of sprite - like in online coloring books?

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