Screenshake problem

Get help using Construct 2

Post » Mon Dec 29, 2014 8:26 am

https://www.scirra.com/manual/102/scroll-to

I read that scrollto's screenshake action WILL ONLY WORK if:
- window size the size of the layout must be bigger than the size of the window
OR
- the layout's Unbounded scrolling property must be set to Yes.

My problem is that I my window size is the same as the layout size (so no scrolling is needed) and I can't set Unbounded Scrolling to Yes because I have extra parts of the BG outside the layout and also if set to yes, if my player walks to the extreme right, the left part of the screen will only show the lifebar (on a layer with no scrolling) so no backgrounds is shown on left part.

I have a camera object (invisible and always set to player's position)

Any way to work around this restraint of scrollto? or how to code a manually coded shake?

Please help. thanks.
Last edited by sgn15 on Mon Dec 29, 2014 9:15 am, edited 1 time in total.
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Mon Dec 29, 2014 8:45 am

You could have a Global variable, say Shake and when you need to shake the screen just do something like this:
Capture.PNG
You do not have the required permissions to view the files attached to this post.
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Mon Dec 29, 2014 9:10 am

Somebody wrote:You could have a Global variable, say Shake and when you need to shake the screen just do something like this:
Capture.PNG

@Somebody
thanks but that is more of a zoom not a screenshake. I need screenshake (given that I cannot change my 2 situations that violate the stated 2 restrictions of scrollto)
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Mon Dec 29, 2014 9:38 am

Shake demo
You do not have the required permissions to view the files attached to this post.
B
249
S
39
G
15
Posts: 1,952
Reputation: 40,579

Post » Mon Dec 29, 2014 10:19 am

Lordshiva1948 wrote:Shake demo

@Lordshiva1948
I might be asking too much but...
can you give me a screenshot of events? I can't install anything here (not my pc) and I don't have r192 of C2 here yet.

Thanks.
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Mon Dec 29, 2014 11:24 am

@Lordshiva1948
ok I made a workaround to make me able to open the file in my current C2 version

You're not exactly helping me with my problem. You got my hopes up for nothing. LEARN TO READ THE FIRST POST.

I said
My problem is that I my window size is the same as the layout size (so no scrolling is needed) and I can't set Unbounded Scrolling to Yes because I have extra parts of the BG outside the layout and also if set to yes, if my player walks to the extreme right, the left part of the screen will only show the lifebar (on a layer with no scrolling) so no backgrounds is shown on left part.
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Mon Dec 29, 2014 2:45 pm

Sorry I do apologies miss understood.
B
249
S
39
G
15
Posts: 1,952
Reputation: 40,579

Post » Mon Dec 29, 2014 4:15 pm

You can try my alternate plugins for the shaking. behaviour-bound-to-layout-plus-scroll-to-plus_t87207

For shaking at the edges to work, you MUST have a layout bigger than the window. Shaking works by scrolling pixels that are outside pf the window, into the window, so there have to be pixels there in the first place. My plugins help here as they offset the layout so that there are always pixels around the edge that can be shaken into view, while locking the view as if the window=layout size.
ImageImageImage
B
71
S
21
G
230
Posts: 3,688
Reputation: 128,847

Post » Tue Dec 30, 2014 6:26 am

@blackhornet

thanks.

Just a few questions though:

1.
window size is 640,480
1 of my layouts is 640,480, so I changed it to 740,580
my insets are:
left = 0
top = 0
right = 100
bottom = 100

I did not change the positions of the objects in my layout, just changed layout size
are the values for inset correct? Not sure I understand them that's why I am asking.

2. I noticed that there is no disable/enable for scroll to plus. There are situations where in a long layout, you fight goons until you reach the final boss on (right) end of layout, I want to make the scroll to stay in that position. So I just set position of camera to something not moving? or is there a more correct/better way of doing it?
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Tue Dec 30, 2014 7:02 am

1) set them all to 50, that gives you 50 pixels around the whole layout - you'll need to shift everything in and down by 50 pixels. (You don't need that much room. The shake is generally only a few pixels.)

2) I've used a separate invisible camera option in the past. It can be pinned to the player, and then unpinned at the appropriate time to hold the screen.
ImageImageImage
B
71
S
21
G
230
Posts: 3,688
Reputation: 128,847

Next

Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 8 guests