Horizontally Mirror View?

A

athunson

Guest
I am new at this and I just figured out view_angle so I use that to vertially flip the view but what I want to do is completely horizontally flip the view of my room. How do I achieve it? Thankyou in advance
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
Setting view_wview to a negative value should work fine for this. You'll likely also have to adjust view_xview so that it's at the right spot.
 
  • Like
Reactions: Yal

jo-thijs

Member
What YellowAfterlive said.
You'll need to be careful though with backgrounds and tiles, those might not be drawn automatically anymore,
so you'll have to draw those yourself.
 
A

athunson

Guest
I tried view_wview like you asked but that didn't flip the camera like I want it to. My view in width is 432 so I changed view_wview into -432. but nothing happened

I forgot to mention I am using d3d
 

Yal

GMC Memer
GMC Elder
Then you should change the code that sets the projection instead. Are you using a perspective projection or an orthographic projection?
 

Surgeon_

Symbian Curator
Why not just turn off automatic drawing of the application_surface and then draw it yourself in the Post Draw event? With draw_surface_ext() you can set the xscale to -1 and have your mirroring effect. Though the problem is, all the text would be mirrored as well...
 

Yal

GMC Memer
GMC Elder
He could draw all the text in the Draw GUI event, right? Or possibly draw the text in the Post Draw event as well after drawing the surface?
 

TheouAegis

Member
What YellowAfterlive said.
You'll need to be careful though with backgrounds and tiles, those might not be drawn automatically anymore,
so you'll have to draw those yourself.
view_wview *= -1;
view_xview -= view_wview;

Sure enough, the lone tile I had in my room was gone. Don't remember that happening in GM8. *sigh*
 

TheouAegis

Member
Why not just turn off automatic drawing of the application_surface and then draw it yourself in the Post Draw event? With draw_surface_ext() you can set the xscale to -1 and have your mirroring effect. Though the problem is, all the text would be mirrored as well...
Also he has to shift the coordinates of the surface. The surface is transformed across it's top-left corner, so drawing the surface at (0,0) when it's not scaled would black out the screen once you flip the scale; so the x offset would need to be surface_get_width(application_surface)*!scale to get the surface to display correctly once flipped.

@Yal Correct, the GUI event is rendered separately from the Post Draw. The Post Draw is apparently before the GUI.
 
Top