Barkley
Barkley

Reputation: 6703

Scrolling screen to the right GameMaker

view_xview += 1

I'm trying to make my screen constantly scroll, but it's not moving.

As far as I'm aware you just make an invisible object on your screen and assign this as a step event to it? I've also heard to make the camera follow an invisible object moving on the screen but this seems better surely?

I've enabled my use of views, enabled it to be seen, I've tried

view_xview += 1 and view_xview[0] += 1 because I've seen both, I'm definitely on view0.

Upvotes: 1

Views: 2058

Answers (2)

Kelvin Shadewing
Kelvin Shadewing

Reputation: 341

The easiest way to do this is to make an object that's invisible but still has a sprite, and just give it an hspeed of 1, then have the view follow it. Create it a bit before the horizontal follow border so that the player can get their bearings before the screen starts moving.

Upvotes: 1

Dmi7ry
Dmi7ry

Reputation: 1777

Where are you placed view_xview[0] += 1? What event? Step? And Object following must be <no object>.

So, all steps must be:

  1. Create object obj_controller
  2. Add event Step, place code: view_xview[0] += 1;
  3. Create room
  4. Place obj_controller to the room
  5. Enable views in the room (Enable the use of Views in the Views tab)
  6. Set Visible when room starts for View 0
  7. Define size/port of the view

Also set Use synchronization to avoid tearing in Global Game Settings -> Windows -> Graphics

Upvotes: 0

Related Questions