[PLUGIN] Canvas

Post your completed addons to share with the community

Post » Sat Jul 28, 2012 1:54 am

[QUOTE=R0J0hound] The increasing ram usage is caused when using webgl. Internally the plugin still uses canvas2d and with webgl a new texture of the canvas is made every frame causing the memory leak. I need to re-write it properly use webgl in an efficient manner.[/QUOTE]

Using 'int(Mouse.X-Canvas2.X)' instead of the standard Mouse.X-Canvas2.X
inside events seems to stop any slowdowns crashes.
B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Wed Aug 08, 2012 4:20 pm

I am using the canvas plugin to capture a rectangular selection of an image....
then 'Canvas.imageUrl' to save the rectangle.

Everything works as expected...but the captured rectangle resizes to its original size in the new browser window.

The following screen captures might illustrate it better-



Any idea how to fix this?
B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Wed Aug 08, 2012 6:09 pm

If you changed the size of the canvas with events the canvas will still have the size it had at edit time internally. This is by design and has it's uses. Use the "resize canvas" action to counteract it.
B
79
S
24
G
54
Posts: 4,743
Reputation: 40,749

Post » Wed Aug 08, 2012 8:34 pm

Thanks ROJOhound...tested and working.
B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Sun Aug 26, 2012 6:00 pm

Question:

Is there a difference between drawing a path or drawing multiple lines between points if rendering is concerned?

I'm fooling around with an animated version of connect the dots but can't get my fps over 20..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
53
S
16
G
8
Posts: 6,157
Reputation: 19,744

Post » Mon Sep 03, 2012 12:02 am

@R0J0hound

Nice plugin!
If I pin a canvas to a moving sprite, it looks fine visually. However, when I use rgbaAt(x,y) the original old placement of the canvas is used, not the new current position.
B
7
S
1
Posts: 74
Reputation: 1,232

Post » Mon Sep 03, 2012 12:20 am

@mutuware
That is by design. "rgbaAt()" gets the color on the canvas' texture, not the color at x,y on the layout.
B
79
S
24
G
54
Posts: 4,743
Reputation: 40,749

Post » Wed Oct 17, 2012 3:50 pm

[QUOTE=R0J0hound] Try sampling the color of the pixel with the expression rgbaAt(x,y) before flood filling.[/QUOTE]
Can you make a exemple of that on a paintbook game?
B
3
Posts: 4
Reputation: 440

Post » Thu Oct 25, 2012 11:35 pm

Is there a way to paste an object or a layer into the canvas plugin and keep the applied webgl effects?

I'm planning to make some iterative shaders, but it seems it's only pasting the original texture, not the image transformed by the effects like CC does.
Scirra Employee
B
129
S
45
G
15
Posts: 705
Reputation: 15,413

Post » Sat Oct 27, 2012 9:52 pm

Do these effects work with the latest version of C2 since i had no luck?

http://dl.dropbox.com/u/5426011/plugins/effectTest/index.html
B
41
S
11
G
4
Posts: 428
Reputation: 7,356

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests