[PLUGIN] Paster

Post your completed addons to share with the community

Post » Fri Aug 08, 2014 5:56 am

@blackhornet



Wow. That's just great. Very elegant solution. Thank you very much!
B
68
S
23
G
9
Posts: 172
Reputation: 7,376

Post » Fri Aug 15, 2014 4:09 pm

I don't understand, how do install this plugin?

EDIT: nvm, i just had to drag the file into the C2 window :)
B
22
S
6
Posts: 244
Reputation: 2,690

Post » Sat Aug 16, 2014 1:03 pm

Hellow, is there a way to know the percentage of the canvas when the new image is copied, example if the canvas has 85% of the new image pasted in it, it will trigger something?

Thanks :)
B
4
Posts: 3
Reputation: 208

Post » Wed Aug 27, 2014 9:04 am

@R0j0hound

At first I thought this bug is exclusive to my project, my last resort is to see your demo. The bug seems to be reproduced, see picture below, happens to all right bottom box/filter/whatever you call that:
R0J0.png

Honestly I don't know what's happening. All my browsers are updated to the latest, maybe something had change.
You do not have the required permissions to view the files attached to this post.
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Thu Oct 02, 2014 9:25 am

I am trying to make some shadows with this plugin, i have a character with lots of animations, i want to paste it as a shadow, i added tint to make it black and i am pasting it with draw quad texture for skewing.
My problem is i can't figure out how to flipped the paster.
Is there a way to do it, besides creating another instance before pasting and flipping that one?

Scratch that, even if i add another sprite, inject the current frame and flip it, draw textured quad draws it not flipped.
Image
B
79
S
29
G
12
Posts: 515
Reputation: 12,584

Post » Thu Oct 02, 2014 11:50 am

nevermind, i just figured out i need to draw the quad points in a different order to get a flipped effect.
Image
B
79
S
29
G
12
Posts: 515
Reputation: 12,584

Post » Thu Oct 02, 2014 10:04 pm

Here is a little shadow test with paster, finally some real shaped shadows!
You can drag the character and the light spot around, "S" will stop and start movement.

Not perfect as 3D shadows, but good enough!

https://c784d66a80c4c3e91d4c1db3ba975cb ... ZNankyd2c/
Image
B
79
S
29
G
12
Posts: 515
Reputation: 12,584

Post » Fri Oct 10, 2014 9:49 am

Here is the test capx for creating shadows with paster:

shadowsPaster.capx


Note, if you have webgl effect on the object you're pasting (like tint for example in my case), you can't paste the object with opacity, so in my case i create a separate paster for each light source and for each character on start of light and assign it to the character and then i set the paster object opacity instead, it's heavier on performance this way, but i couldn't find another solution.
You do not have the required permissions to view the files attached to this post.
Image
B
79
S
29
G
12
Posts: 515
Reputation: 12,584

Post » Fri Oct 10, 2014 10:14 am

@Lof, This is excellent!! Could you please take some pain to explain a bit math at high level in the "Draw textured quad" functions for the benefit of people like me ? Or any reference links where I can find bit more information on such things will be also very helpful...hats off! :)
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 » Fri Oct 10, 2014 10:38 am

You need to take a few things into consideration:

1. add another 2 image points at the right and left edges of your sprite - for all the frames and animations (we used bbox bottom in our case for Y, but you can use an image point), this is done so when you mirror the image the shadow will mirror too.
2. spotlight.Y represent the position of the light source, you can alternatively add a var to your sprite with this value, if you want to create a sun lightsource for example you'll need to push it to really high to around -20000 on the Y axis, so it's probably better using a var.
3. Sprite.X and Sprite.Y represent where the light source is falling, should be the lowest ground point on the same X point as the spotlight.

The rest is general, you don't need to change any of it.
Image
B
79
S
29
G
12
Posts: 515
Reputation: 12,584

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 9 guests