Zooming In And Scrolling to Player

For questions about using Classic.

Post » Tue Sep 08, 2015 5:01 pm

Today i wanted to port my current work from C2 to CC, but there is a problem now.
In Construct 2 i work with 8x8 Sprites and just do :
On Start of Layout = Set Layout Scale to "4";

to "zoom" in and make my game look closer to the camera.

And in C2 i use the behaviour "SrollTo" on the player to make the camera follow him.
How do i do that in CC as there is no behaviour like that .


Thanks!
B
27
S
7
G
3
Posts: 300
Reputation: 4,563

Post » Wed Sep 09, 2015 12:33 am

Luckily the "ScrollTo" behavior is simple, use the System Scroll To Object command in an "Always" event and choose your player object.

As for zoom, you have the option of Set Zoom in the Display category or Layer category of System actions. The first zoom option is the whole game, the second one is for a specific layer and can be combined for cool effects if you wanted to experiment with that.
"Construct 4 lets YOU make advanced games! (but not play them)" Construct Classic - Examples Kit Dropbox is a pile of trash and if you need my old files PM me! :)
B
116
S
41
G
17
Posts: 2,204
Reputation: 19,545

Post » Wed Sep 09, 2015 12:19 pm

Jayjay wrote:Luckily the "ScrollTo" behavior is simple, use the System Scroll To Object command in an "Always" event and choose your player object.

As for zoom, you have the option of Set Zoom in the Display category or Layer category of System actions. The first zoom option is the whole game, the second one is for a specific layer and can be combined for cool effects if you wanted to experiment with that.

Theres now a problem i cannot imagine where it came from.
I fell blind ..

Thats my Eventsheet.
(Zooming works i assume from the debug)

Scrolling not ?
Image

Image
Image
B
27
S
7
G
3
Posts: 300
Reputation: 4,563

Post » Wed Sep 09, 2015 1:22 pm

That issue might be because the object is too close to the edge of the layout. Try turning on unbounded scrolling in the layout properties (so in right project side, click the layout, then on the left properties box check "unbounded scrolling").

Then you can use invisible solid sprite (added as a checkbox under groups > attributes in object properties) objects for the borders instead.
"Construct 4 lets YOU make advanced games! (but not play them)" Construct Classic - Examples Kit Dropbox is a pile of trash and if you need my old files PM me! :)
B
116
S
41
G
17
Posts: 2,204
Reputation: 19,545

Post » Wed Sep 09, 2015 7:13 pm

Jayjay wrote:That issue might be because the object is too close to the edge of the layout. Try turning on unbounded scrolling in the layout properties (so in right project side, click the layout, then on the left properties box check "unbounded scrolling").

Then you can use invisible solid sprite (added as a checkbox under groups > attributes in object properties) objects for the borders instead.

i really dont find out whats wrong, heres my .cap aswell..
Would appreciate if you could find whats wrong

http://dl.m1mk.de/private/NewPlatformer.cap
B
27
S
7
G
3
Posts: 300
Reputation: 4,563

Post » Wed Sep 09, 2015 9:07 pm

Hmm you are right, looks like this is a bug so you will need a trial-and-error workaround I think:

You can keep the Set Zoom to (200,200) enabled instead of using layer for the "Start of Layout" event.

The always event I find works well with System actions:

Scroll to X: Sprite.X - (DisplayWidth / (ZoomX / 10))
Scroll to Y: Sprite.Y - (DisplayHeight / (ZoomY / 10))

This works well for 1024x768, but you might want to tweak the number 10 in that for smaller resolutions.
"Construct 4 lets YOU make advanced games! (but not play them)" Construct Classic - Examples Kit Dropbox is a pile of trash and if you need my old files PM me! :)
B
116
S
41
G
17
Posts: 2,204
Reputation: 19,545

Post » Wed Sep 09, 2015 10:09 pm

Jayjay wrote:Hmm you are right, looks like this is a bug so you will need a trial-and-error workaround I think:

You can keep the Set Zoom to (200,200) enabled instead of using layer for the "Start of Layout" event.

The always event I find works well with System actions:

Scroll to X: Sprite.X - (DisplayWidth / (ZoomX / 10))
Scroll to Y: Sprite.Y - (DisplayHeight / (ZoomY / 10))

This works well for 1024x768, but you might want to tweak the number 10 in that for smaller resolutions.


But why does the normal way work for other users ?
i treid it on different Computers with different CC Versions and ist always looking like this ..

Anyone here who can fix my .cap ?
The scroll just wont work , thank you for the alternative way but i want to get it to work in a simpler way like it was before
B
27
S
7
G
3
Posts: 300
Reputation: 4,563

Post » Tue Sep 29, 2015 1:31 pm

bump
B
27
S
7
G
3
Posts: 300
Reputation: 4,563

Post » Tue Sep 29, 2015 8:41 pm

From a quick look I saw that your sprite's hotspot is way off. Open the picture editor, select hotspot and press 5 on the num keypad to center the hotspot over your sprite. Confirm the change when closing the picture editor, then try again.
Image
B
24
S
8
G
10
Posts: 1,821
Reputation: 8,279

Post » Wed Sep 30, 2015 9:05 am

tulamide wrote:From a quick look I saw that your sprite's hotspot is way off. Open the picture editor, select hotspot and press 5 on the num keypad to center the hotspot over your sprite. Confirm the change when closing the picture editor, then try again.


that solved it ! Thank you very much, i just havent looked at this :D thanks !
B
27
S
7
G
3
Posts: 300
Reputation: 4,563


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 19 guests