I Wanna Community

Fangames => Game Design => Programming Questions => Topic started by: TheGamerGuy500 on February 15, 2016, 03:36:59 PM

Title: Flip/Mirror views involving the cam object. (Klazen's Studio Engine) (RESOLVED.)
Post by: TheGamerGuy500 on February 15, 2016, 03:36:59 PM
This screenie should tell you how I set it up, of course with me blindly thinking that this would, I dunno, WORK?
Anyway, I'd like some assistance with making this work if you would please...
(https://prntscr.com/a3q05z/direct)
You might have to just visit https://prntscr.com/a3q05z to see a zoomed in version of it.
The image should tell you all you need to know.

"Lots of removed spaces so just" means I just put a lot of spaces to hide any irrelevant code. Forgot to finish typing that.

I've also tried using surfaces and that works UNTIL YOU SHIFT THE CAMERA and then everything goes black. In fullscreen, it moves the whole camera an entire screen to the left or right. In the normal window, it's just black. https://prntscr.com/a3qduo
Title: Re: Flip/Mirror views involving the camera object. (Klazen's Studio Engine)
Post by: lawatson on February 15, 2016, 03:56:22 PM
you might have to use surfaces. draw the view to a surface, then draw the surface with xscale -1.
Title: Re: Flip/Mirror views involving the camera object. (Klazen's Studio Engine)
Post by: TheGamerGuy500 on February 15, 2016, 03:56:57 PM
Just added that to the post, it doesn't work after you shift the camera...
(https://prntscr.com/a3qduo/direct)
Title: Re: Flip/Mirror views involving the camera object. (Klazen's Studio Engine)
Post by: TheGamerGuy500 on February 16, 2016, 12:13:29 PM
you might have to use surfaces. draw the view to a surface, then draw the surface with xscale -1.
I had used the application surface method, and the manual says surfaces are like unstable when you do other things with the computer.
If you could supply me with some kinda fail-proof code for drawing a view-only surface with this engine, I'd appreciate that.
Title: Re: Flip/Mirror views involving the cam object. (Klazen's Studio Engine) (Unsolved.)
Post by: patrickgh3 on February 16, 2016, 02:57:55 PM
Here's how I would do make a camera object to do this using views: https://klazen.com/gm/07Q (https://klazen.com/gm/07Q).

However, now I realize it might be simpler just to redraw the application surface flipped. So either do the solution above or the solution below, but not both obviously.

In Studio, add this snippet to a Draw GUI End event:
Code: [Select]
if global.mirror {
    draw_surface_ext(application_surface,800,0,-1,1,0,c_white,1)
}
Title: Re: Flip/Mirror views involving the cam object. (Klazen's Studio Engine) (Unsolved.)
Post by: TheGamerGuy500 on February 16, 2016, 03:19:51 PM
Thanks for the help, but the first option creates the same tile-less effect as before, and redrawing the application surface doesn't work in big rooms that use the camera object. When I start the file with global.mirror, it just presents a black screen. I even put it in DrawGUI end...

EDIT: Whoops, I still had a screen-flipping code in world.roomstart. so the application surface method kinda works? I went back to a previous application surface code I found online, and that works until I go down a screen, then it's all black. this is also with the original camera's code listed in the screenie.

EDITS EDIT: Okay, so all I had to do with the app surface is not base it upon view co-ords. It works, but transparent objects get raped though. Thank you guys so much for your help.