[PLUGIN] Canvas

Post your completed addons to share with the community

Post » Thu Jan 26, 2012 5:57 pm

[QUOTE=newt] What about allowing the user to save those contents , like right click save as, or click an object, open a save dialog?
I know the regular context menu is disabled, so the latter would probably be best.[/QUOTE]


There is tutorial about saving the canvas image,(not Construct)
HERE
B
19
S
6
G
7
Posts: 1,206
Reputation: 7,300

Post » Tue Jan 31, 2012 6:30 am

Not 100% sure but I think there may be a bug with the getImageUrl expression.
Return in a text object returned nothing, but using the browser object, open url in a new window returned what I'm guessing is a base 64 string.

Also would I safe in assuming that method would allow me to do my previous request of being able to save a modified canvas?
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273

Post » Tue Jan 31, 2012 7:40 am

If you double the height of the Text object you will see the text. It seems that if a word is wider than the text object then it is sent to the next line.

I can only find a IE solution to provide a save as dialog to save the image. For now using the browser object to open ImageUrl and right-clicking save as is the simplest way that comes to mind.
B
79
S
24
G
54
Posts: 4,755
Reputation: 40,773

Post » Tue Jan 31, 2012 7:55 am

[QUOTE=R0J0hound] If you double the height of the Text object you will see the text. It seems that if a word is wider than the text object then it is sent to the next line.

I can only find a IE solution to provide a save as dialog to save the image. For now using the browser object to open ImageUrl and right-clicking save as is the simplest way that comes to mind.[/QUOTE]

Oddly enough, it doesn't work in IE, but does in FF, and Chrome.

Image url that is.newt2012-01-31 07:56:28
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273

Post » Mon Feb 13, 2012 6:34 am

If anyone is wanting to change SVG to canvas, use this to get coordinates etc http://www.professorcloud.com/svg-to-canvas/
saves a bucket of time!
B
16
S
4
G
1
Posts: 18
Reputation: 2,568

Post » Tue Mar 27, 2012 1:22 am

In C2, what is the best way to display a resizable rectangle? With this plugin?

Or just make a square sprite and change its dimensions?

Or is it about the same in terms of memory/speed for a 1-50 instances?

One thing I want to do is make a view-port rectangle in a minimap.

(A one-pixel un-filled rectangle would work. Or I could draw a rectangular sprite, resized on the fly, to represent the same thing.)

ThanksJaycephus2012-03-27 05:48:55
B
14
S
4
G
1
Posts: 26
Reputation: 1,747

Post » Thu Mar 29, 2012 6:32 am

Right now, I'm using a plain sprite rectangle to indicate the viewport on the minimap, resizing depending on zoom level.

But I'm also curious about whether 'drawing' a lot of enemies, bullets, missiles, etc, is better than using pixel sprites instead.
B
14
S
4
G
1
Posts: 26
Reputation: 1,747

Post » Fri Mar 30, 2012 1:30 am

The Canvas plugin does not use webgl so I would say that using sprites is faster.   Also sprites would use less memory since multiple instances share the same image, whereas the canvas has a separate image per instance.

If you have webgl disabled you may get better performance by using one canvas and drawing rectangles to that, but you would have to do tests to see if that indeed is the case.
B
79
S
24
G
54
Posts: 4,755
Reputation: 40,773

Post » Fri Mar 30, 2012 5:07 am

Thanks very much for the reply. Appreciate it!
B
14
S
4
G
1
Posts: 26
Reputation: 1,747

Post » Sun Apr 01, 2012 12:14 pm

Is it possible to change color of some part of sprite - like in online coloring books?
B
109
S
6
G
6
Posts: 14
Reputation: 7,327

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 1 guest