[PLUGIN] Canvas

Post your completed addons to share with the community

Post » Wed Jul 13, 2016 6:14 pm

@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.
B
84
S
27
G
70
Posts: 4,934
Reputation: 49,560

Post » Wed Jul 13, 2016 6:50 pm

R0J0hound wrote:@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.


Hi @R0J0hound

Thanks for the reply.

I know about these actions but I don't know how to implement it to create these shapes freely (clicking and dragging to get the size they want to the shape). I think I need to insert some information in the width/height fields.

Thanks for the explanation about how to erase the drawing.
B
67
S
13
G
2
Posts: 987
Reputation: 6,835

Post » Thu Jul 14, 2016 1:23 am

@RBuster

Here is a sample capx for undo/redo of drawing on canvas. It uses my undo&redo plugin to store the image of canvas for each step.
B
100
S
23
G
197
Posts: 4,216
Reputation: 113,922

Post » Thu Jul 14, 2016 10:33 am

Thank you, @rexrainbow. Surely I will use it.
B
67
S
13
G
2
Posts: 987
Reputation: 6,835

Post » Wed Jul 20, 2016 9:31 pm

there's no way to flip or mirror the canvas. I was hoping there'd be a way. Am I overlooking something??
I want to copy a layer and flip/mirror it.
I've tried setting width to negative, and it still draws canvas as unmirrored.
B
37
S
19
G
45
Posts: 909
Reputation: 27,322

Post » Thu Jul 21, 2016 2:05 am

@prominent
The paste actions will draw objects as they appear. So to flip it you need to flip after pasting.

Every tick
--- canvas: paste layer 1
--- canvas: set width to -self.width
B
84
S
27
G
70
Posts: 4,934
Reputation: 49,560

Post » Thu Jul 21, 2016 4:15 am

I did that, but it doesn't flip it.
It has negative width, but the image is drawn unflipped.
B
37
S
19
G
45
Posts: 909
Reputation: 27,322

Post » Thu Jul 21, 2016 4:45 pm

@Prominent
A quick look shows it doesn't draw right with negative dimensions, but you can make it negative, paste then make it positive again:

Every tick
--- canvas: set width to -self.width
--- canvas: paste layer 1
--- canvas: set width to abs(self.width)
B
84
S
27
G
70
Posts: 4,934
Reputation: 49,560

Post » Thu Jul 21, 2016 5:40 pm

I went and tried that, and it doesn't work. It just displays unflipped.
B
37
S
19
G
45
Posts: 909
Reputation: 27,322

Post » Thu Jul 21, 2016 7:32 pm

B
22
S
13
G
20
Posts: 1,755
Reputation: 14,749

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 0 guests