[PLUGIN] Paster

Post your completed addons to share with the community

Post » Tue Jan 05, 2016 12:19 am

@Juicy
This plugin isn't really useful for doing destructible terrain. I mean it works visually but you can't do collisions with it. The canvas plugin can since you can read the pixels with it. However better than canvas is using the tilemap plugin with 1x1 tiles. With it collisions need no extra work, but it does take some more work to setup the canvas and make it erase a circle.
Probably this:
pixel-by-pixel-destructible-terrain-yup-why-not_p725018?#p725018
or this one may give some ideas:
how-do-i-create-an-quot-infinity-quot-map-using-span-class-posthili_p983271?#p983271

For best performance use only one tile on the tilemap and instead color it with another object and a blendmode.
B
91
S
31
G
102
Posts: 5,232
Reputation: 67,250

Post » Tue Jan 05, 2016 8:52 am

@R0J0hound, First I have to quickly say THANKYOUFOREVERYTHING. This plugin is awesome. Second and less caps-locky...

I've been trying to load large images only when I need them, and then kill them off. I have a few 2048x2048 and I want to run the whole thing on iPhone. I managed to load the png inside the Paster but when I destroy it or load another image, memory still stays full. Now release in memory can be detected in CocoonJS ram profiler nor the Construct 2 data on debug. Is there a workaround on this? Can I empty unused items in the Plugin?

Thank you once again
B
37
S
6
G
1
Posts: 301
Reputation: 2,860

Post » Wed Jan 06, 2016 6:17 pm

@damjancd
Try the link again. I think I haven't been considering object recycling when the instances were destroyed. now it discards the references to the textures/canvas' when an instance gets destroyed. If that doesn't work then I'm at a loss.
B
91
S
31
G
102
Posts: 5,232
Reputation: 67,250

Post » Wed Jan 06, 2016 10:16 pm

@R0J0hound

...do i download new version from the 1st post?
B
26
S
11
G
2
Posts: 669
Reputation: 5,038

Post » Wed Jan 06, 2016 10:48 pm

@irina
yeah, I just updated the link.
B
91
S
31
G
102
Posts: 5,232
Reputation: 67,250

Post » Fri Jan 08, 2016 6:55 am

@R0J0hound it works in CocoonJS latest perfectly!!! Thank you. Now I can load a massive white star and unload it on demand :) Lazyloading on CocoonJS YEAH
B
37
S
6
G
1
Posts: 301
Reputation: 2,860

Post » Tue Jan 19, 2016 3:19 am

Hi R0J0 - thanks for taking the time to make such a great plugin. I might be a bit dim, but could you explain how to use the "Load texture from canvas" correctly? What I'm trying to do is to just replicate the entire game canvas in realtime (all layers etc) and load texture from canvas seems to do this, but if the paster is placed on that same canvas it causes a sort of image recursion (which makes sense) - but is there a way to avoid this? I've tried broadcasting the game canvas to a paster object offscreen and then set up another paster object that is meant to receive this image but it still doesn't work - so I think I must just be missing something fundamentally simple about how this plugin works - my capx is here: https://www.dropbox.com/s/kdg7lp6d6rjlx ... .capx?dl=0 - note that I realise I could achieve the reflection effect very simply by pasting the object rather than the whole canvas in this particular example, but in the context of my actual game it needs to be the whole thing. Any help much appreciated.
B
64
S
25
G
4
Posts: 204
Reputation: 6,993

Post » Tue Jan 19, 2016 3:52 am

@signaljacker
I don't think you can use the action to do that, the recursion is unavoidable. The best you could do, I suppose, would be to every other frame hide the paster and then call that action the next frame and make it visible again.
On another note, I wouldn't recommend using the "Load texture from canvas" action, as it doesn't work reliably and doesn't work at all on a lot of browsers.

This link may be helpful though. It has an example that will paste all the objects of a layer with the correct zorder. It just requires all the object type you want to paste to be added in the events. At the very least it will help until I get ambitious enough to add layer pasting into the plugin.
viewtopic.php?f=147&t=164456&p=995191&hilit=zindex#p995191
B
91
S
31
G
102
Posts: 5,232
Reputation: 67,250

Post » Tue Jan 19, 2016 7:43 am

Thanks for the insight - if the load texture from canvas action isn't reliable I won't use it - thanks for the link to the workaround, I think I will be able to re-jig my screen to get it to do what I need - cheers! :)
B
64
S
25
G
4
Posts: 204
Reputation: 6,993

Post » Sun Jan 24, 2016 6:01 pm

I was able to make this using the plugin
Image
:D
B
29
S
6
G
2
Posts: 232
Reputation: 2,893

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 1 guest