Note that as I mentioned before I was not using this for the shadow effect. I just raised it as an example to the problem.
I found this problem because of this, which was meant to be a joke in one of the recent threads. It is actually a large scrolling room, and the "game" continuously grabs the portion of the background around the player and stores a distorted version as a DynamicSprite. What you see in that clip is that I actually used an object and changed its position to match the current Viewport in repeatedly_execute_always(). The problem is that it doesn't work so well, as when the Viewport follows the character's movement the characters is actually still moving after repeatedly_execute_always() ends, so that the Viewport is still being changed at last moment before actual render of the screen, making the object shaking and not snapped to a fixed screen position (it may not be instantly obvious from looking at that clip). I've tried also changing the Viewport according to the player's position, but the obvious drawback is that now the player shakes.
Overlays and GUIs are good as they use screen coordinates and so they could be snap-fit at fixed positions of the screen but they're not applicable in this case since they're always drawn in front of stuff (of course, it's possible to have me just draw the player sprite on top of the DynamicSprite and use this as an Overlay to cover up the whole screen, but this is not an elegant solution, especially if there're a certain number of objects on-screen at a time).
So the last resort is to use a character, as FOLLOW_EXACTLY in FollowCharacter() would just move the stalker sprite at the right time to keep it in-sync with the player (and thus the Viewport). However, this has to be placed behind everything and clearly its bottom edge has to be the bottom of the screen. Theoretically this could be done by setting the baseline as high as possible and setting its z value to -120 or something (if the screen height is 240), but because of the limitation mentioned it just could not be done.
I found this problem because of this, which was meant to be a joke in one of the recent threads. It is actually a large scrolling room, and the "game" continuously grabs the portion of the background around the player and stores a distorted version as a DynamicSprite. What you see in that clip is that I actually used an object and changed its position to match the current Viewport in repeatedly_execute_always(). The problem is that it doesn't work so well, as when the Viewport follows the character's movement the characters is actually still moving after repeatedly_execute_always() ends, so that the Viewport is still being changed at last moment before actual render of the screen, making the object shaking and not snapped to a fixed screen position (it may not be instantly obvious from looking at that clip). I've tried also changing the Viewport according to the player's position, but the obvious drawback is that now the player shakes.
Overlays and GUIs are good as they use screen coordinates and so they could be snap-fit at fixed positions of the screen but they're not applicable in this case since they're always drawn in front of stuff (of course, it's possible to have me just draw the player sprite on top of the DynamicSprite and use this as an Overlay to cover up the whole screen, but this is not an elegant solution, especially if there're a certain number of objects on-screen at a time).
So the last resort is to use a character, as FOLLOW_EXACTLY in FollowCharacter() would just move the stalker sprite at the right time to keep it in-sync with the player (and thus the Viewport). However, this has to be placed behind everything and clearly its bottom edge has to be the bottom of the screen. Theoretically this could be done by setting the baseline as high as possible and setting its z value to -120 or something (if the screen height is 240), but because of the limitation mentioned it just could not be done.