Make background sky in large room

N

nick13579

Guest
So I want to make a sky in the background of my side-scrolling game. The room is very long (sideways), but the view is smaller (1920x1080). I don't want to make the sky sprite as big as the room and make it stay in one place because that would make it look like it's not far away. What I want the sky to be is the same size as the view, not the same size as the room, and follow the view so it looks like it isn't moving when the player moves.

What I am doing right now is have the sky sprite assigned to an object and I have this in the objects step event, "x = view_xport[0]"

I thought it would be this easy, but it isn't working. The object's x is only set to the view's x once, like it's in a create event. I don't even know if I should be using an object anyway.

So how would I make the object follow the view. Or should I draw the sprite to the view instead?

Thanks!
 
L

Linkdeous

Guest
is your player moving in the room or everything move but the player ?
 
L

Linkdeous

Guest
Ok then, so it just becasue you used the wrong function, you don't want to use xport but view_xview[0] then as simple as that, ithought you used port becasue your view was static, but heh, guess i misunderstood from the very start, but anyway, xport is used to check where the view will be in the drawed area, if you didn't changed it, it will stay as 0 , whereas view_xview take the coor of the view in the game room , so it should be good with view_xview, hope it helped you, if it don't work again just tell so
 
N

nick13579

Guest
Ya that's what I have always used on the previous game maker. I'm on GMS 2 now and I looked for view_xview and it isn't there.... So I thought they changed the function name to view_xport because I had never seen that one before. I am so confused now.
 
Top