How do I make a layer only visible in a region? [SOLVED]

Get help using Construct 2

Post » Fri Jul 17, 2015 5:52 pm

I want to make certain objects in a layer only be seen within the "screen" of an object, the rest should be behind the background or simply not visible, been wondering for some time only finding really innefficient methods, I know there must be a simple way of approaching this... Any help?
Image
Last edited by CloveltOc on Sat Jul 18, 2015 9:51 am, edited 1 time in total.
B
9
S
3
Posts: 152
Reputation: 1,270

Post » Fri Jul 17, 2015 6:01 pm

Not sure about the best simple way of doing this, but here's how I would approach it:
1. I would edit the animation of the "phone" object and add another image point and place that point in the upper-left corner of the "phones" "screen".
2. Then I would take the other sprites, I make them initially invisible and set their origin points to 0, 0.
3. Then I would make events if sprite position(x, y) is equal to the position(x,y) of the "phones" image point, then set sprite x visible.
If it's not equal then set it back to invisible. And do that for both sprites, or if you have more sprites, create a family put them in it, and then do that event for the family.
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Post » Fri Jul 17, 2015 6:06 pm

You can probably just recreate the Example: Lighting file but with your screen.

Basically, try setting the screen's blend mode to Destination Out, then make the layer the screen is on opaque and turn on Force Own Textures for it.
B
52
S
24
G
18
Posts: 295
Reputation: 13,090

Post » Sat Jul 18, 2015 8:56 am

Hmm, I don´t think I could do @VIKINGS ´ idea because I use smooth sliding and that would leave some parts of the screen empty with sprites popping etc... I´ll give both a try right now anyway! Thanks a lot
B
9
S
3
Posts: 152
Reputation: 1,270

Post » Sat Jul 18, 2015 8:59 am

It should be as easy as choosing the right blendmode..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Jul 18, 2015 9:15 am

Y̶e̶a̶h̶,̶ ̶I̶ ̶d̶o̶n̶´̶t̶ ̶u̶s̶e̶ ̶t̶h̶e̶m̶ ̶o̶f̶t̶e̶n̶.̶.̶.̶ ̶I̶t̶ ̶w̶o̶r̶k̶s̶ ̶u̶s̶i̶n̶g̶ ̶d̶e̶s̶t̶i̶n̶a̶t̶i̶o̶n̶ ̶o̶u̶t̶ ̶b̶u̶t̶ ̶m̶y̶ ̶o̶n̶l̶y̶ ̶c̶o̶m̶p̶l̶a̶i̶n̶ ̶i̶s̶ ̶t̶h̶a̶t̶ ̶I̶ ̶c̶a̶n̶´̶t̶ ̶f̶i̶n̶d̶ ̶a̶ ̶w̶a̶y̶ ̶t̶o̶ ̶p̶u̶t̶ ̶b̶a̶c̶k̶g̶r̶o̶u̶n̶d̶ ̶o̶b̶j̶e̶c̶t̶s̶ ̶t̶h̶a̶t̶ ̶a̶r̶e̶ ̶b̶e̶h̶i̶n̶d̶ ̶t̶h̶e̶ ̶s̶c̶r̶e̶e̶n̶ ̶b̶u̶t̶ ̶o̶n̶ ̶t̶o̶p̶ ̶o̶f̶ ̶t̶h̶e̶ ̶s̶o̶l̶i̶d̶ ̶b̶a̶c̶k̶g̶r̶o̶u̶n̶d̶!̶

L̶a̶y̶e̶r̶s̶:̶
-̶s̶t̶u̶f̶f̶ ̶(̶s̶o̶l̶i̶d̶ ̶c̶o̶l̶o̶r̶,̶ ̶h̶a̶s̶ ̶t̶h̶e̶ ̶d̶e̶s̶t̶i̶n̶a̶t̶i̶o̶n̶ ̶o̶u̶t̶ ̶o̶b̶j̶e̶c̶t̶)̶
-̶s̶c̶r̶e̶e̶n̶ ̶(̶h̶a̶s̶ ̶a̶l̶l̶ ̶t̶h̶e̶ ̶c̶o̶m̶p̶o̶n̶e̶n̶t̶s̶ ̶t̶h̶a̶t̶ ̶h̶i̶d̶e̶ ̶b̶e̶h̶i̶n̶d̶ ̶"̶s̶t̶u̶f̶f̶"̶´̶s̶ ̶s̶o̶l̶i̶d̶ ̶b̶a̶c̶k̶g̶r̶o̶u̶n̶d̶)̶
-̶b̶a̶c̶k̶ ̶(̶c̶a̶n̶´̶t̶ ̶b̶e̶ ̶s̶e̶e̶n̶ ̶b̶e̶c̶a̶u̶s̶e̶ ̶o̶f̶ ̶"̶s̶t̶u̶f̶f̶"̶´̶s̶ ̶s̶o̶l̶i̶d̶ ̶b̶a̶c̶k̶g̶r̶o̶u̶n̶d̶)̶
Last edited by CloveltOc on Sat Jul 18, 2015 9:49 am, edited 2 times in total.
B
9
S
3
Posts: 152
Reputation: 1,270

Post » Sat Jul 18, 2015 9:46 am

Never mind, figured this out. Thanks, everyone!
B
9
S
3
Posts: 152
Reputation: 1,270


Return to How do I....?

Who is online

Users browsing this forum: dand, mageekm, oosyrag and 28 guests