[PLUGIN] Canvas

Post your completed addons to share with the community

Post » Mon Dec 05, 2016 11:23 am

Can i resize canvas without blur? Like "Sample: Point" from the C2.
Becouse i'm made a pixel art in 32x32... when i paste in canvas, i resize to 128x128, then when i invoke download frim the canvas, the image has same "blur".
B
14
S
6
G
2
Posts: 81
Reputation: 2,241

Post » Wed Dec 07, 2016 1:40 pm

Hey, can you inplement clearRect function?
B
14
S
6
G
2
Posts: 81
Reputation: 2,241

Post » Mon Dec 12, 2016 6:38 pm

@Cherico
You need to built the text with the & operator. For example: "rgb(" & variable1 & "," & variable2 & "," & variable3 & ")"

@andykenobi
I haven't worked on this in a bit. I think I fixed the sampling in the paster plugin but I'm avoiding working on plugins.

You can paste a sprite with the "destination-out" blend to erase. I'm probably not adding anything more to this plugin.
B
94
S
33
G
113
Posts: 5,353
Reputation: 73,267

Post » Sun Jan 01, 2017 11:31 am

Hi @R0J0hound

Happy new year!

I am using this amazing plugin that is helping me a lot but I am having some issue when I create a family with canvas: the game does not stop to load the files when I try to access it through the Safari. Do you know something about that? Is it possible to fix it or give some alternative solution to use in place of the canvas family?

Thanks in advance.
B
74
S
13
G
4
Posts: 1,006
Reputation: 8,060

Post » Sun Jan 01, 2017 12:52 pm

R0J0hound wrote: I'm probably not adding anything more to this plugin.


Thanks R0J0 for your great support with the plugin...However it beats me why scirra wouldn't build such a common and useful canvas feature as an in-built feature of C2? I find so many use cases where I have to use canvas and I strongly feel that this should be inbuilt into C2.
For game development / IT services contact - [email protected]

List of published iOS apps -
https://itunes.apple.com/us/artist/ravi ... d693234511
B
84
S
20
G
3
Posts: 337
Reputation: 7,368

Post » Sun Jan 01, 2017 8:02 pm

@RBuster
So it doesn't load if the canvas is in a family, and on on safari? I guess I never tested that. I'm not sure I'll get around to finding a fix.

@kmsravindra
This was asked a few times previously. Basically Construct Classic had a plugin like this and since C2 didn't have one at the time so I made this. I probably beat them to it, that's all. Scirra doesn't seem to duplicate third party plugins just because.
B
94
S
33
G
113
Posts: 5,353
Reputation: 73,267

Post » Sun Jan 01, 2017 8:26 pm

R0J0hound wrote:@RBuster
So it doesn't load if the canvas is in a family, and on on safari? I guess I never tested that. I'm not sure I'll get around to finding a fix.


Yes, R0J0hound

Do you know other alternative than family I can use with canvas? I am using more than 60 canvas objects and I need to control all of them sometimes.
B
74
S
13
G
4
Posts: 1,006
Reputation: 8,060

Post » Mon Jan 02, 2017 3:22 am

@RBuster
I don't apart from duplicating events. The plugin is probably causing a hang due to the family and I'd guess it would happen in other browsers.

I don't have the canvas plugin installed currently and haven't made any time to work on plugins. However I seem to recall a similar problem with another plugin. The solution as I recall is to find the "typeProto.onCreate" function in the runtime and adding an if to stop the function if it's a family.

Code: Select all
typeProto.onCreate = function()
   {
      if (this.is_family)
         return;

Maybe that will fix it.
B
94
S
33
G
113
Posts: 5,353
Reputation: 73,267

Post » Mon Jan 02, 2017 12:19 pm

R0J0hound wrote:@RBuster
I don't apart from duplicating events. The plugin is probably causing a hang due to the family and I'd guess it would happen in other browsers.

I don't have the canvas plugin installed currently and haven't made any time to work on plugins. However I seem to recall a similar problem with another plugin. The solution as I recall is to find the "typeProto.onCreate" function in the runtime and adding an if to stop the function if it's a family.

Code: Select all
typeProto.onCreate = function()
   {
      if (this.is_family)
         return;

Maybe that will fix it.


Thanks, @R0J0hound but it not worked. I decided to create an event for each canvas object and now the game is working in the Safari too.

I am wondering know how can I get the JSON of the canvas. I know that is possible but I really don't know how to get it. Could you give some help with this?

Thanks in advance.
B
74
S
13
G
4
Posts: 1,006
Reputation: 8,060

Post » Mon Jan 02, 2017 8:36 pm

You can get the json of the canvas with the canvas.asJson expression.
B
94
S
33
G
113
Posts: 5,353
Reputation: 73,267

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests