[PLUGIN] Paster

Post your completed addons to share with the community

Post » Fri Oct 02, 2015 9:33 am

@savvy001
You should be able to do it by pasting the Sprite into the canvas then pasting a another sold Sprite that covers the paster object. The second object should have the destination out blend and just change the opacity to lower than 100. You'll also want to make the second object invisible when not pasting.
The only caveat is it never fades all the way to transparent, although it gets close.

@BadMiracle
No eta for a fix. I haven't touch the plug in a while.
The particles off screen aren't drawn so the only workaround I can think of is to move both the particles and paster object on screen before pasting.
Here's the offset.
Offsetx = particles.x-scrollx
Offsety = particles.y-scrolly
Subtract it from the partircle and paster positions,
Paste the particles,
Then add the offset again.
B
94
S
33
G
118
Posts: 5,395
Reputation: 75,851

Post » Fri Oct 02, 2015 4:45 pm

@R0J0hound

Could you explain in a bit more detail? Sorry I'm awful I know.

Here I am trying to redraw the "Sparks" particle doing what you said (but I don't think I followed correctly) - Whatever I try seems to crash the browser
Image
B
86
S
29
G
10
Posts: 100
Reputation: 10,535

Post » Fri Oct 02, 2015 6:51 pm

@BadMiracle
Ok here's a capx how to do it.
https://dl.dropboxusercontent.com/u/542 ... aster.capx

The idea I posted was on track but was flawed.
For tilemaps, it's enough to move the area you want to paste onscreen and move the paster by the same amount.
For particles that wouldn't work as moving particle objects doesn't move the already spawned particles. The solution was to save the particles position when it was created then move it to the center of the screen.
B
94
S
33
G
118
Posts: 5,395
Reputation: 75,851

Post » Sat Oct 03, 2015 1:51 am

R0J0hound wrote:@BadMiracle
Ok here's a capx how to do it.
https://dl.dropboxusercontent.com/u/542 ... aster.capx

The idea I posted was on track but was flawed.
For tilemaps, it's enough to move the area you want to paste onscreen and move the paster by the same amount.
For particles that wouldn't work as moving particle objects doesn't move the already spawned particles. The solution was to save the particles position when it was created then move it to the center of the screen.


Yes x1000

@R0J0hound Are they paying you yet? @Scirra
B
86
S
29
G
10
Posts: 100
Reputation: 10,535

Post » Mon Oct 12, 2015 11:34 pm

Hey @R0j0hound. I'm getting an error/crash if I paste an object that has the "Brightness" shader on it. I tested it with a few others like "Tint" and I got the same thing.

Image

Any idea what that's about? :T
Image
B
243
S
30
G
13
Posts: 1,787
Reputation: 18,770

Post » Tue Oct 13, 2015 12:03 am

@Tokinsom
C2's webgl renderer looks like it was updated to have more parameters for effects. Looking at that particular line it looks like time is now passed to the effects.

Looking at line 408 in paster/runtime.js
Code: Select all
glw.setProgramParameters(this.temp_texture,    // backTex
    1.0 / inst.width,      // pixelWidth
    1.0 / inst.height,      // pixelHeight
    0, 1,                // destStartX, destStartY,
    1, 0,               // destEndX, destEndY,
    1,                  // this.getScale(),
    0,                  // this.getAngle(),
    0, 0,               // this.viewLeft, this.viewTop,
    0.5, 0.5,            // (this.viewLeft + this.viewRight) / 2, (this.viewTop + this.viewBottom) / 2,
    inst.effect_params[etindex]);


Add this line: "this.runtime.kahanTime.sum,"
Code: Select all
glw.setProgramParameters(this.temp_texture,    // backTex
    1.0 / inst.width,      // pixelWidth
    1.0 / inst.height,      // pixelHeight
    0, 1,                // destStartX, destStartY,
    1, 0,               // destEndX, destEndY,
    1,                  // this.getScale(),
    0,                  // this.getAngle(),
    0, 0,               // this.viewLeft, this.viewTop,
    0.5, 0.5,            // (this.viewLeft + this.viewRight) / 2, (this.viewTop + this.viewBottom) / 2,
    this.runtime.kahanTime.sum,
    inst.effect_params[etindex]);

And that should fix it. I can't test, webgl no longer works on my pc.
B
94
S
33
G
118
Posts: 5,395
Reputation: 75,851

Post » Tue Oct 13, 2015 12:56 am

@R0j0hound Sure did! Thanks man.
Image
B
243
S
30
G
13
Posts: 1,787
Reputation: 18,770

Post » Sun Oct 18, 2015 4:44 pm

@R0J0hound

I can create a second paster instance at runtime, i can clear it to a color, but i cant past anything in it.
Is this fixable?
B
59
S
21
G
14
Posts: 779
Reputation: 13,927

Post » Sun Oct 18, 2015 7:33 pm

@Savvy001
Nothing should prevent you from doing so, as long as something is picked to paste.
B
94
S
33
G
118
Posts: 5,395
Reputation: 75,851

Post » Sun Oct 18, 2015 7:54 pm

Strange because it is not working.
I have now pre-made lots of instances, changed nothing in the events and then they all paste.
But this way its not dynamic.
I must take another look at it then :-)
B
59
S
21
G
14
Posts: 779
Reputation: 13,927

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 4 guests