Mask troubles.

Get help using Construct 2

Post » Sat Mar 03, 2012 12:29 pm

Im trying to mask a sprite I have, I tried making a animation in flash then using destination out to mask the mask created in flash(You'll understand when you see the capx) But that didn't work.

I also tried to do it a way I have seen it done on the forums but I cannot get this working Can someone help me out please.

Thanks.

Capx - http://db.tt/u9D515Lg
B
6
S
1
G
1
Posts: 42
Reputation: 810

Post » Sat Mar 03, 2012 1:27 pm

Why not just export it with a transparent background?
Haven't really mucked around with masking yet, sorry.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sat Mar 03, 2012 6:19 pm

I don't really understand what it's all about in your capx. But in short you want to make a kind of healthbar on a weird shape withough having to draw all the animation frame.
I did something similair a while ago. I think if you understand this capx you might be able to adapt it to what you want to do:
heartHUD.capx

I just made this version to show how to use a texture as hp "blood"
heartHUD2.capx
Last edited by Yann on Sun Sep 14, 2014 9:26 pm, edited 1 time in total.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Sat Mar 03, 2012 6:55 pm

@Yann, Thanks for the help. I am trying to do the same thing as the heart example but I want it to use width instead of height. I tried to change all the Y's to X's and all the Height's to widths but it didn't work. Maybe you can help? Thanks.
B
6
S
1
G
1
Posts: 42
Reputation: 810

Post » Sat Mar 03, 2012 7:21 pm

I added a trick, To know what is the height of a full heart, I place 2 images points on the heart outline. One for the empty position, one for the full position. I then calculated the height between them and use it as a min/max for the height of the blood mask.

You just have to replace theses image points and calculate the difference between imagepointX instead of imagepointY... Well send the capx if you don't succeed
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Sat Mar 03, 2012 7:28 pm

@Yann, If you look at the capx I provided I tried that, I could not get it working, Can you please help me Yann.

I just want to have a timer, then have a max time, then the blue line will display the percentage of the time. I can do the timer maths. Just need help with the mask
B
6
S
1
G
1
Posts: 42
Reputation: 810

Post » Sat Mar 03, 2012 8:06 pm

You also need to make sure the image points at the bottom of objects are replaced to the sides.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sat Mar 03, 2012 8:39 pm

Last edited by Yann on Sun Sep 14, 2014 9:26 pm, edited 1 time in total.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Sat Mar 03, 2012 9:47 pm

@Yann, Thanks. I actually learned something from that.

But I wanted the the blue color to come over the wooden shape, being masked like this: but blue - http://dl.dropbox.com/u/51270524/Look.jpg
B
6
S
1
G
1
Posts: 42
Reputation: 810

Post » Sat Mar 03, 2012 9:48 pm

Oh also, I could open the capx, but there was a error. Looks like you modified the facebook plugin?
B
6
S
1
G
1
Posts: 42
Reputation: 810

Next

Return to How do I....?

Who is online

Users browsing this forum: Artpunk, Braus, Kagubro, Mirlas, zeneizel and 22 guests