Can you try it from scratch?
Start with a empty file, create a background + sprite + object + room ( doesn't matter what the background & sprite look like ). Assign the sprite to the object and add Create + Step events containing "Execute Code" actions. In the Create event code you put "camera_x = 0;" and in the Step event the snippet from my last post. Add the object to the room, assign the background and set the view & port to 320 x 240. Finally, set the room speed to 60 and press Run.
Done.
First:
i assume you want a 60fps game
No, i wanted the default 30 speed, like most games made with this tool (i believe). I've never written i wanted a 60 FPS game.
With your settings the background still stutters. I've done that before and i've done this now. I swear to god, i'm not making a fool out of anybody!
I've started to think that without any workaround to the view i'll never solve this problem.
I'll give my reasons.
Firstly, I've found a solution to make my background stop stuttering.
I've found out that using "d3d_set_projection_ortho" does fix the background stuttering. But it's also weird and not very practical.
I've written this into the "Begin Draw" event:
d3d_set_projection_ortho(view_xview[view_current], view_yview[view_current], view_wview[view_current], view_hview[view_current], 0)
But with this setting, there is no effect, the background still stutters.
So ve made this into the step event of a object:
global.my_xview = view_xview[view_current]
global.my_yview = view_yview[view_current]
Obviously, i've declared them in the Create event.
Finally, i've put this one instead in the "Begin Draw" event:
d3d_set_projection_ortho(global.my_xview, global.my_yview, view_wview[view_current], view_hview[view_current], 0)
May it be magic, but this keeps my background from stuttering
the problem is that the background stops stuttering... while my moving box stutters instead. Even if i round its x/y position.
This bring me to the next reason i need my view move smoothly.
A smooth view is probably syncrhonized with the rest of the surrounding objects and backgrounds. That's why i believe it's a good idea having the views moving like the rest of the objects. Really, is there a way to make the view move like it does in Shovel Knight, namely, between pixels?
Now, rounding the background position doesn't work with "background_x[0] = global.my_xview * 0.5" because with this code the view can't synchronize with the background (i really don't get why, may it be the "*0.5"?). Using "d3d_set_projection_ortho" fixes the background stutters but adds stuttering to the rest of the objects, even to those with rounded values. I believe i've no other solution in mind besides making the view synchronized with the rest of the movements.