update canvas object !

This forum is currently in read-only mode.
0 favourites
From the Asset Store
Pixel Destruction like in "Worms" (Drawing Canvas based)
  • the canvas object seems really basic at the moment, it cant darw elipses, or polygons between points, also perhaps set the possibility of removing from the canvas, so lets say you want to draw detructible terrain, you simply plot an elipse, and set it to erase from canvas object (value 1 is no value 2 is yes) something like that., if u were to say erase from canvas object with an ellipse/polygon that was lets say 50% transparent, it would leave a 50% transparent spot on the canvas, which you could see through.

    i really believe polygons which u set the point for like draw shape with points 1.x,1.y,2.x,2.y,3.x,3.y ect ect, (no limit so you can make any number of points that youd like.)

    should exist also, mmf2's overlay object is quite better than the canvas object, not enough properties are defineable. and essential features like drawing circles and erasing certain areas with those shapes or pasted sprites are inexistant.

    a canvas object is really good if you want breakable terrain, and you cant do that with it!

  • You can erase from the terrain by pasting in a sprite that has the erase effect applied.

    As for the idea of polygons, elipses, etc. I definitely think that's a good idea.

  • how does erase/mask effect work? i never understood what they do and how to use them

  • 1 - Make a sprite and draw a big white circle

    2 - Give the sprite the 'erase' effect

    3 - Give the sprite mouse movement

    4 - add a canvas object and load some random image off your computer

    5 - add an event 'always - paste sprite into canvas'

    Now run it and you have an eraser on your canvas

    Try adding a gradient or something behind the canvas, and you will see the background appear through the image.

  • As for elipses and polygons, as the canvas object can draw any object into itself, its more likely we'll create a polygon plugin separately (so we can get vector graphics and all that pwetty stuff)

  • yea, but if u ever used mmf2 you see its pretty usefull to have polygons on the object, after all it would be HWA but vectors are not. its simply finding points, and drawing lines, then filling in the average of all the point postions right?, something like that, but its impposible to do this atm, it needs a little more work, and ellipses should be a basic drawing Op

  • yea, but if u ever used mmf2 you see its pretty usefull to have polygons on the object, after all it would be HWA but vectors are not.

    But it's the drawing that's hardware accelerated, whether it's vector or not. Vector, raster, don't make a difference. In the end it's all just telling your graphics card what pixels to make.

    If there is going to be a vector object in the future, then putting polygon functionality into the canvas object as well would just be redundant, because you can just paste the vector object into the canvas.

    And actually that would make the canvas' current point, line and rect actions pretty much obsolete.

  • it's a hell of a lot quicker to have:

    canvas object -> paste circle radius r at (x,y)

    than to make a circle vector object and set it up loads and then paste it into it, especially if you've got to set up an erase blend on a new layer with that thing that makes erase work ticked.

  • [quote:2pimchfj]especially if you've got to set up an erase blend on a new layer with that thing that makes erase work ticked.

    You dont need to put objects on new layers and stuff when pasting into the canvas. The object simply renders into the canvas itself, so if it has an 'erase' effect on it, it will work as expected (as canvas has an alpha channel). It should work with any object and any pixel shader.

  • nice, (I didn't actually try it)

    It's obviously not necessary, but I wouldn't rule it out entirely, just if you can be arsed add it ages after 1.0 and after the vector object, just as an ease of use thing.

  • it's a hell of a lot quicker to have:

    canvas object -> paste circle radius r at (x,y)

    than to make a circle vector object and set it up loads and then paste it into it, especially if you've got to set up an erase blend on a new layer with that thing that makes erase work ticked.

    Sure it would be quicker, but it's still redundant.

    If the canvas object has vector and polygon drawing functions, and the vector object has vector and polygon functions, then the vector object would basically be the canvas object without the canvas. So what would be the point?

    It's like saying there should be two kinds of Sprite object... a regular sprite that you have to apply effects to by hand, and a sprite that has all the effects built in automatically that you just toggle on and off. Just doesn't make any sense to me.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • i disagree, you must realise that processing an ellipse in vector is CPU intensive, and i think its quite redundant to have to make a circle, move the circle and paste a circle, then destroy the circle, also having to edit the circle properties before you paste it, and destroy a circle, when you could just draw a circle at a point on a canvas with given params, its much cleaner and much less cpu intensive. saying a circle is redundant is like saying

    "why have a line draw function on the canvas?, why not just make a 1x1 sprite which you resize to the desired length, rotate and paste into the canvas, having a line draw function is just down right redundant, heck, why even use a canvas at all, its redundant"

    an ellipse function is barely redundant, its a simple drawing function which would complete the canvas object, i dont understand why it should only be for lines and pasting, it should be able to draw polys and ellipses.

  • I agree that more primitives should be added to the Canvas object. However, DirectX 9 has no built in way of drawing an ellipse. Any implementation we came up with would be along the lines of create a texture with a big circle in it, then draw the texture resized to how you want your ellipse. So if you're worried about the pasting-a-circle-sprite method being inefficient, it's not. It's how you have to do it!

  • If I have understood this thread correctly...

    I don't see what all the fuss is about really... it's easy enough to just do something like:

    bomb hits ground => create bomb radius object (erase shader) => destroy bomb radius object

    You can make the "explosion" any shape you want easily, and it takes 2 seconds to make the event to handle every single "bomb" or "bullet" or whatever in the event of destructible terrain.

    ~Sol

  • i disagree, etc.

    It's redundant because one object would have the same functions as the other. That's what redundant means.

    It's like having a hammer, a knife, and a hammer with a knife attached to it. One of those things has more functionality than it needs. It's just not necessary.

    Plus, there are several legitimate uses for a canvas object without having to draw polygons on it.

    And there would be several legitimate uses for a polygon object without having to paste the results into a canvas.

    So if they have separate functionality, keep them separate. It's more efficient that way. You don't need a knife on your hammer to drive nails.

    And it's not that hard to paste something into the canvas anyway. It's one action. You're making it sound as though it would be like pulling teeth to use two objects in conjunction.

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