[PLUGIN] Canvas

Post your completed addons to share with the community

Post » Thu Sep 29, 2016 10:43 pm

Hi,

This looks great. I am wanting to create a basic interactive whiteboard app for my students. Are there any tutorials on how to use canvas? (i.e. How to do paint bucket fills, eraser tools etc?)

Also, is there anyway to 'replay' recently drawn lines? I'm wanting to be able to write something and then replay the strokes for the students - similar to this flash game http://www.ictgames.com/writingRepeater/
B
7
S
2
G
1
Posts: 3
Reputation: 981

Post » Fri Sep 30, 2016 2:14 am

@sletts
There may be some tutorials that I'm unaware of but it's pretty easy to use. Just look at the actions and most are self explanatory. It uses the HTML5 canvas so you could google tutorials for that and it's mostly a one to one with this plugin.
There's an action to do a flood fill and erasing is done by pasting an object with the destination out blend mode.

Replaying should just be a matter of making a list of the actions you used as you use them. Then just make some events to loop over the list and does what was saved. You probably could use an array to do the list.
B
79
S
24
G
53
Posts: 4,732
Reputation: 40,227

Post » Fri Sep 30, 2016 11:54 am

R0J0hound wrote:@sletts
There may be some tutorials that I'm unaware of but it's pretty easy to use. Just look at the actions and most are self explanatory. It uses the HTML5 canvas so you could google tutorials for that and it's mostly a one to one with this plugin.
There's an action to do a flood fill and erasing is done by pasting an object with the destination out blend mode.

Replaying should just be a matter of making a list of the actions you used as you use them. Then just make some events to loop over the list and does what was saved. You probably could use an array to do the list.


Thanks! Now that I've played a bit more I feel more confident.

Regarding the replay of drawing - I'm a bit stuck. To clarify, I would like a student to be able to draw in the app (i.e. trace a word) and then click the 'replay' button and it will replay exactly what they just drew.

Is that possible?
B
7
S
2
G
1
Posts: 3
Reputation: 981

Post » Fri Sep 30, 2016 5:31 pm

Yes it is possible. The plugin does nothing to help, but you can do it by other means.
B
79
S
24
G
53
Posts: 4,732
Reputation: 40,227

Post » Thu Oct 06, 2016 1:50 am

Awesome plugin, very powerful.

Just an observation: The expressions "RGBA At" (When called multiple times in the same frame update) causes a considerable impact on performance when playing the game with Firefox.

Google Chrome seems to handle the same events pretty well.

Thanks for sharing this, I love it!
B
7
S
2
Posts: 25
Reputation: 935

Post » Sun Nov 06, 2016 1:04 am

I have a problem with your plugin, Paste layer results in a poor quality when the project properties is set to high quality scaling

Image
Image
B
12
S
3
G
3
Posts: 5
Reputation: 2,158

Post » Sun Nov 06, 2016 6:37 am

@elanorawesome
There's a "resize canvas" action, that sets the texture size used by the canvas. By default it uses the size on the layout but for high quality scaling you'll want the texture size to be bigger. So for a canvas covering the viewport you'd want the texture size to be (windowwidth, windowheight) for example. Keep in mind that that action to change the canvas size will lose what was previously drawn.
B
79
S
24
G
53
Posts: 4,732
Reputation: 40,227

Post » Sat Nov 19, 2016 11:18 pm

I've got a replace color effect on my sprite here, but when I paste it onto the canvas, I get something like this.
Am I missing something that makes it paste the right colors?

Image
B
11
S
2
Posts: 30
Reputation: 815

Post » Sun Nov 20, 2016 10:22 pm

@Fervir
Effects don't work for this plugin. You can try the Paster plugin instead which was made with more webgl support.
B
79
S
24
G
53
Posts: 4,732
Reputation: 40,227

Post » Tue Nov 22, 2016 1:08 pm

Effects also don't work on Paster ... What a pity! For Canvas and Paster :(

But i have a other problem/question: is it possible to use fill color from variables?

What i mean:
For example it works fine when i say <On start of layout> = <Fill canvas with color ""rgb(50,100,200)">, but it dont work when i use variables instead of the numbers (like "rgb(Canvas.Variable1, Canvas.Variable2, Canvas.Variable3)")
B
20
S
5
G
2
Posts: 175
Reputation: 3,462

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 6 guests