[PLUGIN] Canvas

Post your completed addons to share with the community

Post » Wed Nov 09, 2011 7:46 pm

Canvas Plugin updated 2/9/2014
Download:
http://dl.dropbox.com/u/5426011/plugins/canvas.zip

Actions:
Paste Object
Resize canvas
Draw point
Draw line
Draw box
Fill color
Clear canvas

New R2:
[Fix] Canvas will now automatically redraw.

Actions:
+ Fill canvas with gradient

Path drawing actions:
+ Begin Path
+ Move to
+ Line to
+ Quadratic to
+ Bezier to
+ arc
+ Rectangle path
+ Set line Settings
+ Fill path
+ Draw path

Expressions:
+ rgbaAt
+ getImageUrl

New R3:
[Fix] pasting objects on scaled canvas'.
+ The draw line action now has a line width parameter [warning: may cause capx made with previous version not to open.
+ Draw circle action.
[Fix] When choosing colors the alpha value is in the range of 0 to 1, rgbaAt now returns a usable value.

New R4:
[Fix] Now works with WebGL. (thanks to Yann)
[Add] Additional hotspot locations top-right,top, etc...(thanks to Yann)
[Add] Paste Layer action(thanks to Yann)
[Change] Paste object/layer action now only paste visible objects.

New R5:
[Add] FloodFill. (Thanks to Pode)

One of the interesting features this has is the way colors are chosen.
You can use any of the following:
"black", "blue", "orange", "gold", etc...
"#00FF00"
"rgb(100, 10, 1)"
"rgba(20, 30, 40, 0.5)"
"hsl(120, 50%, 50%)"
"hsla(120, 50%, 50%, 0.5)"
Note: alpha values are from 0 to 1.

Another nice side effect of this plugin is you can now use all the effects that html5 has to offer.
http://dl.dropbox.com/u/5426011/plugins/effectTest/index.html

capx:
http://dl.dropbox.com/u/5426011/plugins/effectTest.capx


If anyone encounters any bugs or has a feature request for this let me know.

-cheersR0J0hound2014-02-09 23:17:12
B
36
S
3
G
6
Posts: 2,179
Reputation: 8,626

Post » Wed Nov 09, 2011 8:04 pm

This is WICKED cool. Thanks, Rojo!
B
14
S
2
G
3
Posts: 301
Reputation: 2,693

Post » Wed Nov 09, 2011 8:06 pm

Looks interesting, cheers :)
If your vision so exceeds your ability, then look to something closer.
B
53
S
12
G
11
Posts: 1,615
Reputation: 11,212

Post » Wed Nov 09, 2011 8:16 pm

Been hoping for this. :)
Thanks

Any thoughts on using some of the other functions, arc, paths, etc?
B
104
S
32
G
18
Posts: 4,759
Reputation: 22,503

Post » Wed Nov 09, 2011 8:36 pm

wow this is great!,

but could it be that it doesn't react to mouse input or mouse position?

tried on mouse down, draw point at mousex mousey but nothing..
B
32
S
9
G
5
Posts: 648
Reputation: 6,394

Post » Wed Nov 09, 2011 9:03 pm

Drawing is relative to the canvas, so if the canvas has it's hotspot at the top left corner you would use:
Draw point (Mouse.X-Canvas.X, Mouse.Y-Canvas.Y)


@newt
That should be doable, I'll work on adding that.
B
36
S
3
G
6
Posts: 2,179
Reputation: 8,626

Post » Thu Nov 10, 2011 4:27 am

I like it!

Could you add one more action to fill gradual color?
Ah, just a suggestion.rexrainbow2011-11-10 04:51:47
B
61
S
13
G
11
Posts: 1,906
Reputation: 14,050

Post » Thu Nov 10, 2011 11:19 am

@R0J0hound: I just noticed that if you want pixels added in realtime to the canvas when drawing with the mouse, you need to "force refresh" on the canvas. To do that, I use two actions consequently (i.e SetInvisible by SetVisible). Apart from that, everything is great !
B
33
S
8
G
5
Posts: 705
Reputation: 6,046

Post » Thu Nov 10, 2011 7:01 pm

New version released. Re-download from first post.

@newt
You can draw with paths now.
https://developer.mozilla.org/en/Canvas_tutorial/Drawing_shapes
capx:http://dl.dropbox.com/u/5426011/plugins/pathDraw.capx

@rexrainbow
Added fill canvas with gradient. It has horizontal,vertical,diagonal and radial.

@Pode
It will refresh automatically now.
B
36
S
3
G
6
Posts: 2,179
Reputation: 8,626

Post » Thu Nov 10, 2011 7:23 pm

Wow, its a canvas smorgasbord!
Thanks again.
B
104
S
32
G
18
Posts: 4,759
Reputation: 22,503

Next

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 0 guests