Heya guys, I have a pretty specif thing that I'm trying to do with two objects that I can't seem to wrap my head around doing.
I have an object that acts as an overlay sunlight that sits atop everything on the screen, and sorta another that sits beneath an island on the water surface that gives the illusion of sunlight resting atop the water. In the repeatedly execute, I want to have both the objects always snap to the screen X and Y of (0 & 559). This way whenever the player moves around the screen sunlight/surface light will always be fixed in the same spot.
My problem lies in the fact that I actually can't figure out the correct way to apply this through code?
Code: ags
Hopefully this something that's actually possible to do? I don't think I've had to work with the screen functions before, so there might be some setting up that I could be missing?
I have an object that acts as an overlay sunlight that sits atop everything on the screen, and sorta another that sits beneath an island on the water surface that gives the illusion of sunlight resting atop the water. In the repeatedly execute, I want to have both the objects always snap to the screen X and Y of (0 & 559). This way whenever the player moves around the screen sunlight/surface light will always be fixed in the same spot.
My problem lies in the fact that I actually can't figure out the correct way to apply this through code?
function room_RepExec()
{
//Originally I had this, but then realized it would only snap to the room x,y
Water_light.X = 0
Water_light.Y = 559;
sunlight.X = 0;
sunlight.Y = 559;
//Then I tried this before realizing it can only get, not set
Water_light = Screen.Viewport.X = 0;
Water_light.Y = Screen.Viewport.Y = 559;
//Now I'm at a loss, as I can't figure out anything else that could help at the moment.
}
Hopefully this something that's actually possible to do? I don't think I've had to work with the screen functions before, so there might be some setting up that I could be missing?