Good video. How would you change your code once you have a camera zoom (different viewport values then camera values) because this pretty much messes up the whole concept shown here.
There will be a bunch of assumptions here. So say you are zooming and then setting the camera with camera_set_view_size(camera, camera_width, camera_height); Then what you would be doing, is checking for the change of camera_width or camera_height (or mouse scroll, etc).. Once you have detected a change, then you simply change the application surface size. So in 2.3 I would have a "resize" function on my camera object that would handle everything. resize = function() { camera_set_view_size(camera, camera_width, camera_height); if(surface_exists(application_surface)) { surface_resize(application_surface, camera_width, camera_height) } } Once your application surface is resized the values still work without having to figure out ratio and a bunch of math. Otherwise when you scroll in, your "zoom" (camera width/height) is now different than your application surface. And you have to apply some math to get the right coordinates.
Hello, good video, I had a problem when drawing the reflection, the "application_surface" variable only copies the background, the player object omits it. what could be happening?
This is amazing. What should I do if the reflective surface is a mirror and want to change the hue of the reflection or reflect a different game object?
You would need to apply a shader to the object that is doing the drawing. Basically you will end up wrapping the "draw_surface_ext" in a shader. Make any sense?
Don't know what I'm doing wrong but I can't get this to work at all. I've triple checked my code against yours and it is identical. I also double checked those first steps with the variable definitions and they are the same too. It's frustrating because your technique looks like exactly what I need! When I put the objects in my real game room I get a weird reflection of what looks like a bunch of vertical lines. Whereas if I use an almost empty room like your example (with just my player and the reflection objects) I get no reflection at all!
Hi, I tried this tutorial and I am getting things to reflect but the reflection ends up being bigger than the part it captures. Is there a way to fix this?
ok, I was trying several things and I realized that it only works relative to the camera and the room, so if my camera follows the player the reflection is damaged, if my room is bigger than my camera it is also damaged or if I want to apply it to other rooms it is completely damaged, so my final conclusion is that this tutorial is only useful for a specific situation, therefore to achieve the effect I want it has to be in another way, if someone can help me to make a reflection that remains static and that is independent of the camera I would greatly appreciate it...
Try this one then: ua-cam.com/video/bPnl4DpiCl0/v-deo.html With the introduction of layers and effects you can get around all the hard work, and that one doesn't rely on a static camera
this is a fantastic tutorial. had some issues due to my sprites being Middle-Center by default but quickly noticed and fixed. thank you!
i don't want it to reflect everything. i only want to reflect my 'player' layer. is that possible? thanks in advance
Good video. How would you change your code once you have a camera zoom (different viewport values then camera values) because this pretty much messes up the whole concept shown here.
There will be a bunch of assumptions here. So say you are zooming and then setting the camera with
camera_set_view_size(camera, camera_width, camera_height);
Then what you would be doing, is checking for the change of camera_width or camera_height (or mouse scroll, etc).. Once you have detected a change, then you simply change the application surface size. So in 2.3 I would have a "resize" function on my camera object that would handle everything.
resize = function() {
camera_set_view_size(camera, camera_width, camera_height);
if(surface_exists(application_surface)) {
surface_resize(application_surface, camera_width, camera_height)
}
}
Once your application surface is resized the values still work without having to figure out ratio and a bunch of math. Otherwise when you scroll in, your "zoom" (camera width/height) is now different than your application surface. And you have to apply some math to get the right coordinates.
Hello, good video, I had a problem when drawing the reflection, the "application_surface" variable only copies the background, the player object omits it.
what could be happening?
Try running the code in the post draw event
Fantastic tutorial help me a lot tks
This is amazing. What should I do if the reflective surface is a mirror and want to change the hue of the reflection or reflect a different game object?
You would need to apply a shader to the object that is doing the drawing. Basically you will end up wrapping the "draw_surface_ext" in a shader. Make any sense?
GameMaker Casts yes!!! You’re fucking awesome. Thank you
Awesome. Can you reflect the tiles?
Don't know what I'm doing wrong but I can't get this to work at all. I've triple checked my code against yours and it is identical. I also double checked those first steps with the variable definitions and they are the same too. It's frustrating because your technique looks like exactly what I need! When I put the objects in my real game room I get a weird reflection of what looks like a bunch of vertical lines. Whereas if I use an almost empty room like your example (with just my player and the reflection objects) I get no reflection at all!
I could take a look at your project if you want? Just upload it to dropbox or something and I'll have a look (or PM me on discord)
hello, i actually had the same problem with you. have u fixed it yet?. i swear everything is identical but its still not working
can i use that on topdown RPG?
Hi, I tried this tutorial and I am getting things to reflect but the reflection ends up being bigger than the part it captures. Is there a way to fix this?
Another thing, it's not capturing what ever is at the capture target. It seems to be capturing something else and I don't know why.
@@sonshadsilver2138 I have the same issue!
Did any of you guys get it fixed?
I am still waiting for an answer :(
ok, I was trying several things and I realized that it only works relative to the camera and the room, so if my camera follows the player the reflection is damaged, if my room is bigger than my camera it is also damaged or if I want to apply it to other rooms it is completely damaged, so my final conclusion is that this tutorial is only useful for a specific situation, therefore to achieve the effect I want it has to be in another way, if someone can help me to make a reflection that remains static and that is independent of the camera I would greatly appreciate it...
Try this one then: ua-cam.com/video/bPnl4DpiCl0/v-deo.html With the introduction of layers and effects you can get around all the hard work, and that one doesn't rely on a static camera