[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
88
S
30
G
89
Posts: 5,113
Reputation: 60,337

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
40
S
19
G
62
Posts: 1,071
Reputation: 36,289

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
88
S
30
G
89
Posts: 5,113
Reputation: 60,337

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
40
S
19
G
62
Posts: 1,071
Reputation: 36,289

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

Post » Mon Aug 01, 2016 10:55 pm

@RBuster
There is a .asJson expression but it's probably to use the .imageUrl expression.
B
88
S
30
G
89
Posts: 5,113
Reputation: 60,337

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
26
S
6
G
2
Posts: 184
Reputation: 2,934

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
48
S
12
Posts: 111
Reputation: 3,809

Post » Tue Aug 09, 2016 4:43 pm

@byondisoft , thanks! that works :) that is interesting that you have to re-position the canvas.
B
40
S
19
G
62
Posts: 1,071
Reputation: 36,289

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
48
S
12
Posts: 111
Reputation: 3,809

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: Kios and 4 guests