[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
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

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
65
S
13
G
2
Posts: 969
Reputation: 6,732

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
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Post » Thu Jul 14, 2016 10:33 am

Thank you, @rexrainbow. Surely I will use it.
B
65
S
13
G
2
Posts: 969
Reputation: 6,732

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
34
S
18
G
37
Posts: 852
Reputation: 22,947

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
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

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
34
S
18
G
37
Posts: 852
Reputation: 22,947

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
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Thu Jul 21, 2016 5:40 pm

I went and tried that, and it doesn't work. It just displays unflipped.
B
34
S
18
G
37
Posts: 852
Reputation: 22,947

Post » Thu Jul 21, 2016 7:32 pm

B
16
S
10
G
17
Posts: 1,395
Reputation: 12,073

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 0 guests