Possible to Create Multiple Viewports(Cameras)?

Get help using Construct 2

Post » Wed Aug 03, 2016 1:46 am

I searched for a plugin and couldn't find one that did what I needed. I was wondering what would be a practical way to get the same multiple camera effect the game: "Where is My Heart" doing.

Image

It takes the level, then shows only portions of it in different windows and mixes them up so they aren't consecutive.
(For example, the top right and the top middle ones overlap part of the cloud and the heart.)

Thank you in advance.

EDIT: Changed title from "Cameras" to "Viewports(Cameras)"
Last edited by dfernfield on Wed Aug 03, 2016 2:52 am, edited 2 times in total.
B
18
S
8
G
5
Posts: 14
Reputation: 3,830

Post » Wed Aug 03, 2016 1:51 am

Create a blank sprite for each area that you want the camera to be limited to. Then use an event: When Player is OverLapping sprCameraArea1, Move Camera to sprCameraArea1 and so on.

Hopefully, that explains it.
B
56
S
15
G
13
Posts: 825
Reputation: 17,643

Post » Wed Aug 03, 2016 1:56 am

Tekniko wrote:Create a blank sprite for each area that you want the camera to be limited to. Then use an event: When Player is OverLapping sprCameraArea1, Move Camera to sprCameraArea1 and so on.

Hopefully, that explains it.

Wouldn't that only allow for one camera, viewing a single area? Just the sprite area the player is overlapping?
B
18
S
8
G
5
Posts: 14
Reputation: 3,830

Post » Wed Aug 03, 2016 2:03 am

One camera, multiple locations.

Edit:
Give me an hour and I'll put together an example capx.
B
56
S
15
G
13
Posts: 825
Reputation: 17,643

Post » Wed Aug 03, 2016 2:20 am

Here you go. Dig through this and hopefully it helps.

https://www.dropbox.com/s/8x4ixsobadeql4q/CameraSwitch.capx?dl=0
B
56
S
15
G
13
Posts: 825
Reputation: 17,643

Post » Wed Aug 03, 2016 2:31 am

Message: dfernfield can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
Tekniko wrote:Here you go. Dig through this and hopefully it helps.

https://www.dropbox.com/s/8x4ixsobadeql ... .capx?dl=0


Thanks so much for the speedy reply, I've never had a reply on any other forum this fast!

The example is much appreciated, it's not quite what I was trying to do though.
This is what I was trying to accomplish (mute the commentary): https://youtu.be/-HUr5H0oVig?t=3m16s
B
18
S
8
G
5
Posts: 14
Reputation: 3,830

Post » Wed Aug 03, 2016 2:37 am

Oh haha, that is something complete different. I would need more time to play around because I have never created something like that before.
B
56
S
15
G
13
Posts: 825
Reputation: 17,643

Post » Wed Aug 03, 2016 2:50 am

Found a post from 2008 https://www.scirra.com/forum/multiple-cameras_t53580

Suggestion was to allow for a split-screen functionality/support multiple viewports.

It's on the todo list - at the moment the Layout object can't show a portion of the same layout. I guess this would be a kind of Viewport object - I should be able to make it able to show offscreen parts of the layout too, with custom scaling and rotating, which would be pretty cool... It's a good idea, and would allow splitscreen too.


Anyone know anything regarding this?
B
18
S
8
G
5
Posts: 14
Reputation: 3,830

Post » Wed Aug 03, 2016 3:05 am

You can probably do this with Paster, but you'll have to do a lot of the work yourself.
viewtopic.php?t=88750&start=0
ImageImageImage
B
71
S
21
G
220
Posts: 3,649
Reputation: 123,727

Post » Wed Aug 03, 2016 7:55 am

Hmm I think you will need a copy of every sprite object in the game per "camera", and a system to keep track of each "camera" position relative to reach other, and use those to offset the objects. Each set of your sprites would be on their own layer and you would use a blending mode like destination in with force own texture on the layer to create a clipping mask.

Just theory crafting here, have that rough idea in my head but no idea how feasable it is. Might give it a shot later.

It would need a lot of custom code to deal with interaction and sync the viewports'objects... Not unlike net code actually.
Mistakes were made.
B
49
S
24
G
107
Posts: 1,581
Reputation: 60,303


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 12 guests