SHARE
TWEET

Untitled

a guest Apr 22nd, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Make sure you have a player reference.
  2. if (player == noone) player = instance_find(o_Player,0);
  3.  
  4. //Set up camera
  5. view_enabled = true;
  6.  
  7. //Make view 0 visible
  8. view_set_visible(0, true);
  9.  
  10. //Set view bounds
  11. view_set_wport(0, 1280);
  12. view_set_hport(0, 720);
  13.  
  14. //Resize and center
  15. window_set_rectangle((display_get_width() - (view_wport[0] * windowScale)) * 0.5, (display_get_height() - (view_hport[0] * windowScale)) * 0.5, view_wport[0] * windowScale, view_hport[0] * windowScale);
  16. surface_resize(application_surface,view_wport[0] * windowScale,view_hport[0] * windowScale);
  17.  
  18. //Camera creation
  19.  
  20. //Build a camera at (0,0), with size 640x480, 0 degrees of angle, no target instance, instant-jupming hspeed and vspeed, with a 32 pixel border
  21. camera = camera_create_view(0, 0, 1280, 720, 0, -1, -1, -1, 32, 32);
  22.  
  23. //Set view0 to use the camera "camera"
  24. view_set_camera(0, camera);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top