[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
85
S
27
G
79
Posts: 5,018
Reputation: 54,770

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
39
S
19
G
50
Posts: 960
Reputation: 30,015

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
85
S
27
G
79
Posts: 5,018
Reputation: 54,770

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
39
S
19
G
50
Posts: 960
Reputation: 30,015

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

Post » Mon Aug 01, 2016 10:55 pm

@RBuster
There is a .asJson expression but it's probably to use the .imageUrl expression.
B
85
S
27
G
79
Posts: 5,018
Reputation: 54,770

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
24
S
6
G
2
Posts: 179
Reputation: 2,874

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
46
S
12
Posts: 110
Reputation: 3,747

Post » Tue Aug 09, 2016 4:43 pm

@byondisoft , thanks! that works :) that is interesting that you have to re-position the canvas.
B
39
S
19
G
50
Posts: 960
Reputation: 30,015

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
46
S
12
Posts: 110
Reputation: 3,747

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: DeXVinogradov, ishmaelmoreno and 0 guests