[PLUGIN] Canvas

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

    Probably not with this plugin.

  • I was just wondering because I used paster to paste silhouettes of characters in front of obstructions when they're behind them and I had used tint effect to make them show up with different colors based on their character type. Like enemies are red, friends are green, etc. Are you going to continue development on paster by any chance? Or is there a work around I can use to pull off what I did with paster, in canvas?

  • Hello,

    Someone knows if it is normal to have a long delay when using the floodfill on Android devices? Or could be an issue of my game/graphic?

    Thanks in advance!

  • corlenbelspar

    Effects only work in paster currently. And unfortunately there isn't a simple way to do a coloring effect in just canvas. Also development of both plugins is currently suspended due to time and procrastination on my part, but they are in working order for what they do now.

    leofenix

    Floodfill is a slow operation as it is so it would make sense it would be slower on android.

  • R0J0hound

    [quote:3jp6feyg]New R4: [Fix] Now works with WebGL. (thanks to Yann)

    Does this mean that Canvas have the same fps as Paster in WebGL (last time I tried Canvas I've had lower fps than Paster in WebGL)

  • No, it just means it works with webgl as previously it didn't. Internally it still uses a standard canvas and copy's to a webgl texture whenever it's changed. Paster should be faster with webgl since it doesn't do any image copying. Also if webgl is turned off speeds will be about the same.

  • Hi, canvas users,

    I had made a behavior of canvas plugin to draw a radar chart, see this thread.

  • Try Construct 3

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

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

  • you can make a text global var and store: "rgb(255,255,255)" in it.

    or have 3 number vars, one for each color

    and then set to fill with:

    "rgb("&colorVar1&","&colorVar2&","&colorVar3&")"

  • R0J0hound

    Hey Rojo,

    Is there a way to fill the canvas by editing the rgb values using a global variable?

    Let's say I have the global variables

    red = 100;

    blue = 20;

    green = 40;

    And I used the expression "fill canvas with color rgb(red,blue,green)". The canvas then fills itself based on the values in the global variables.

    The problem with the the "fill canvas" expression is that it only accepts strings, is there a way to have it so that it accepts a global variable as a parameter?

    You can turn the expression into a string by putting it in a str() function. So 'str(rgb(red,green,blue))', unless I'm missing something

  • Hi, canvas users again,

    I had made a behavior of canvas plugin to draw gradient with more detail configurations, see this thread.

  • Hi to everybody.......

    is there a way with this plugin to test a pixel color in a sprite or image in a specific location??? any capx example??? could you help me please???

    i saw in this plugin the function rgbAt.....how i can use it ....any instructions??......i have installed the canvas plugin...but inside i haven't seen any instruction or button about that....

    i thank you in advance...

    Lestroso

    http://www.fasasoftware.com

  • 1

    Create new project

    2

    Add mouse, text, and canvas objects

    3

    Give the canvas object an image and position it at 0,0

    4

    Go to the event editor and add a "every tick" condition.

    5

    Add the action: text-> set text to canvas.rgbaAt(int(mouse.x), int(mouse.y))

    6

    Run it and the text object will tell the color under the mouse on the canvas object.

    Extra tidbits:

    Int() is used since mouse.x can give values like 10.5 when window scaling is used and the value needs to be a whole number.

    .rgbaAt uses x and y values relative to the top left of the canvas object. So if you moved the canvas object from 0,0 you'd have to change the expression to:

    Canvas.rgbaAt(int(mouse.x-canvas.x), int(mouse.y-canvas.y))

    Finally notice it only gets the color from the canvas' own texture. Use the drawing actions to change this texture.

  • Thank you a lot for your support....i'll try it as soon as possible....thanks again....

    Lestroso

    http://www.fasasoftware.com

  • Dear rohound,

    i have a problem with your plugin... it don't paste the objects right in the canvas...when i past the object the canvas became all white..the rgbat works fine...

    can you help me please???

    Thanks a lot,

    Lestroso

    http://www.fasasoftware.com

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