[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
94
S
33
G
122
Posts: 5,443
Reputation: 77,949

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
48
S
23
G
66
Posts: 1,147
Reputation: 39,070

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
94
S
33
G
122
Posts: 5,443
Reputation: 77,949

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
48
S
23
G
66
Posts: 1,147
Reputation: 39,070

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
74
S
14
G
4
Posts: 1,035
Reputation: 8,173

Post » Mon Aug 01, 2016 10:55 pm

@RBuster
There is a .asJson expression but it's probably to use the .imageUrl expression.
B
94
S
33
G
122
Posts: 5,443
Reputation: 77,949

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
37
S
13
G
2
Posts: 200
Reputation: 3,893

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
49
S
14
Posts: 111
Reputation: 3,989

Post » Tue Aug 09, 2016 4:43 pm

@byondisoft , thanks! that works :) that is interesting that you have to re-position the canvas.
B
48
S
23
G
66
Posts: 1,147
Reputation: 39,070

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
49
S
14
Posts: 111
Reputation: 3,989

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests