[PLUGIN] Canvas

Post your completed addons to share with the community

Post » Fri Jul 22, 2016 4:51 pm

I just tested it with "paste layer" and it indeed doesn't work. It works with pasting sprites though. The matrix transformation is probably wrong or something. For now I'm not going to fix it, but at least it's known now.
B
79
S
24
G
54
Posts: 4,749
Reputation: 40,761

Post » Tue Jul 26, 2016 12:50 am

Also found another issue.. Fill canvas with color doesn't use correct hotspot location (possibly other actions don't as well?). If I have hotspot of canvas set to center, I need to use bboxleft for X and bboxtop for Y origin point of canvas instead of the actual X,Y coordinate of the canvas object.
Just mentioning it in-case it isn't known.
B
34
S
18
G
38
Posts: 853
Reputation: 23,449

Post » Tue Jul 26, 2016 1:18 am

@Prominent
That one is intentional, well, it's just doing exactly what the html5 canvas does internally. The origin of all the drawing functions is the top/left of the canvas. The layout coordinates only match canvas coordinates when the canvas is unrotated and has it's top left at the top left of the layout.

The only exceptions are the paste functions.
B
79
S
24
G
54
Posts: 4,749
Reputation: 40,761

Post » Tue Jul 26, 2016 2:15 am

okay, no problem.

btw, I noticed canvas will render blurred if x,y aren't whole numbers- so projects with pixel rounding enabled, you have to round the canvas position if you don't want it blurry.
B
34
S
18
G
38
Posts: 853
Reputation: 23,449

Post » Mon Aug 01, 2016 10:01 pm

@R0J0hound

I wonder if is possible to save the user's draw in JSON data format? If so, could tell me how can I do it, please?

Thanks in advance.
B
65
S
13
G
2
Posts: 969
Reputation: 6,732

Post » Mon Aug 01, 2016 10:55 pm

@RBuster
There is a .asJson expression but it's probably to use the .imageUrl expression.
B
79
S
24
G
54
Posts: 4,749
Reputation: 40,761

Post » Tue Aug 09, 2016 8:11 am

Hello @R0J0hound

Why doesn't canvas past SpriteFonts?

Image

Image

I set initial visibility for all objects to invisible and canvas pasted only sprite and text.
B
20
S
6
G
2
Posts: 173
Reputation: 2,762

Post » Tue Aug 09, 2016 2:17 pm

@Prominent: About the mirror/flip issue, I was able to do it by having to adjust the Canvas.X subtracting the width.
Maybe this helps: https://www.dropbox.com/s/24io9jstjh6t3 ... .capx?dl=0
B
38
S
10
Posts: 106
Reputation: 3,265

Post » Tue Aug 09, 2016 4:43 pm

@byondisoft , thanks! that works :) that is interesting that you have to re-position the canvas.
B
34
S
18
G
38
Posts: 853
Reputation: 23,449

Post » Tue Aug 09, 2016 8:37 pm

@Prominent: Indeed.
Maybe that's not the expected behavior.
I remembered having to deal with that in the past in another code. :)
B
38
S
10
Posts: 106
Reputation: 3,265

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 1 guest