[PLUGIN] Canvas

  • Thanks R0J0hound , everything's working as it should now!

  • You can do that with any other sprite as well. Basically you use a layer with "force own texture" and put the canvas and plane in it. The canvas has the "destination out" blend.

    layer 1: force own texture=true

    --- canvas: blend="destination-in"

    --- plane

    layer 0

  • Ok, I already got it, thanks!.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi ,

    I'm new in construct 2. Now, i'm trying change color of a sprite by a gradient , I have used rgbaAt() to get color of the pixel on gradient, but I don't know how change color of sprite by the return value of rgbaAt() ?

    Plesea for me any idea, and sorry because my bad english

  • why does my post keep disappearing I swear I posed a suggestion in this topic before?

    please tell me where it is if it does exist I used the search topic bar for my username

    anyways

    R0J0hound can you make it possible to draw a sprite at a certain layer and position with its animation playing?

    this would be good for hud elements

    also could you make it possible to create a seamless screen loop with this?

    I was thinking the canvas object could work like a camera too and you could be able to draw canvas's to other canvas's

    I'm sorry if I already posted this already I have been gone for quite a while and like I said I can't find that post or the reply's it might have had with it

  • Shadowblitz16

    Have a look at the "paste object" action, it will draw another object to the canvas in the same spot it is overlapping the canvas.

  • R0J0hound

    Could you make a function that allows drawing a sprite and animation at a x and y coordinate?

    something like...

    draw_sprite(object,animation,x,y,w,h)? < action

    also the drawing parts of the canvas to parts of other canvas's would be called something like...

    get_canvas_part(canvas,x,y,w,h) < expression

    draw_canvas_part(canvas,x,y,w,h) < action

  • R0J0hound re Wolf ( and even doom ) style: I looked at your old rayast4 example. But I wander wouldn't be easier to just generate walls from sprites instead of havng points and lines, many variables and still only generate flat walls. With sprites it could be set to generate a wall for each side and top and bottom, and not only that, but now variable could be used to determine z axis position. So that would be the theory, you can make doom style 3d, however I'm not skilled enough at maths to do it. If you'd be able to help, that would be so super.

  • Shadowblitz16

    That's what the paste action is for. Just position and set the animation of a Sprite before calling the action. The second idea would need to be done with blend modes and the paste action as well.

    You could use that new raycasting plugin so you can cast rays to a collision polygon. Otherwise you could also come up with a way to create the lines from the sprites. Doom style maps could be tricky since a lot of tricks are used to go from wolf3d raycasting to that. Also it's not terribly interesting to me since I didn't get good performance with just doing walls, let alone floors. I'd need a way to make it much faster to make it worthwhile.

  • R0J0hound

    there is anyway to save the canvas data ?

    for example

    if there is a color book and the kid will close the app but when he comes back to it he will find the last color he did .

  • I'm trying to procedurally generate fantasy maps in an old-fashioned parchment style (think Tolkien's maps) in my current project, and the curve drawing functions look like they'd be perfect for making natural-looking rivers, roads etc... afraid I can't quite get my head around how they work though! Is there a tutorial for using them anywhere?

    Many thanks again on a fantastic plugin R0J0hound

  • lolpaca

    Look here for a visual of what they are. You can ignore the math.

    https://en.wikipedia.org/wiki/B%C3%A9zier_curve

    The curves made of 3 points are the "quadratic curves" and 4 points are the "bezier curves".

    The first and last points are the end points and the points in between are control points.

  • Ah, that helps a lot. Thanks!

  • R0J0hound

    I would like to provide to the user the possibility of drawing squares and circles with any size and I don't know how to do it with your plugin. Do you have any example that I can see to understand how to implement it?

    Edited: Is possible an example about how to erase the lines and shapes?

  • RBuster

    There's a "draw box" and "draw circle" action that can do that.

    To erase you have to clear everything with the "clear canvas" action and re-draw everything else. Another idea is to draw over the thing last drawn with white or whatever the background color was. I guess for either you need to come up with a way to keep track of what was drawn.

    It's much like mspaint in that once something is drawn it's just pixels.

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