viewport

  1. Xalezar

    GML Automatically set camera and viewport properties through code?

    I have a game in which all the rooms will be the same size (playable levels, start screen, menus, etc.). Currently, I'm manually entering values in the map editor for the X Pos, Y Pos, Width, Height, etc. for each room. But I'm wondering if I can leave those input fields alone, and just set the...
  2. B

    GameMaker Changing viewport when switching rooms

    I'm trying to get my viewport dimensions to change when I go from one room to another, but I can't seem to make it work. In the creation code of the room I want to change the viewport dimensions of, I have view_wport[0] = 480; view_hport[0] = 854; camera_set_view_size(view_camera[0]...
  3. GDK

    GameMaker Draw GUI - not working properly?

    Hey guys, I'm having an issue with aligning the GUI to where I want it. I think I know what might be the issue but I'll lay it out here and see what you guys think. So keeping in mind I want a very centralised layout of the GUI: How I've currently tried to achieve a centralised layout...
  4. O

    HTML5 Camera shake issue in HTML5 (but works for Mac/PC)

    Hi, Does anyone have any idea why this works fine when exported to Mac/Windows but not HTML5? view_xport[0] = random_range(-10,10); view_yport[0] = random_range(-10,10); Thanks for your help! Oliver
  5. S

    Stopping the viewport from moving on game over

    How do I stop the a viewport with automatic movement from moving on game over? When my player object is destroyed the screen keeps moving and the score and life count leaves the screen HELP!
  6. F

    view_camera[0] not udated when setting camera according to manual

    Here is how I set my camera: camera = camera_create(); var _vm = matrix_build_lookat(x,y,-100,x,y,0,0,1,0); var _pm = matrix_build_projection_ortho(cam_xdim, cam_ydim, 1.0, 32000.0); camera_set_view_mat(camera, _vm); camera_set_proj_mat(camera, _pm)...
  7. C

    Circular viewport (or camera) in GMS 2

    Hi I would like to make a circular secondary viewport for a minimap. How to go about that? It is easy enough for me to create a rectangular one (with zooming and scrolling and all that) using the built in viewports, but a circular one...?? I dont know where to begin: can it be done using the...
  8. J

    How to draw sprite in viewport (SOLVED)

    I'm using a variation of shaun spauldings fade to black code a = clamp(a + (fade * 0.009),0,1); if (a == 1) { room_goto_next(); fade = -1; } if (a == 0) && (fade == -1) { instance_destroy(); } draw_set_alpha(a); draw_sprite(spr_black,0,view_xport[0],view_yport[0]); < --- where the...
  9. D

    GameMaker Make camera area bigger without pixelization

    Hello! I currently have a room set up where I've enabled viewports, set the viewport to visible, and set the camera/viewport size to the default 1024x768. Sprites in the game are all 64x64. My question is this: I'd like to make the camera area larger, so that more of the room shows around...
  10. 0

    GameMaker Make view(port) always the same as window size

    Hello Community I'm currently developing a "sim city" 2D city-builder style game and I am trying to build a realiable and flexible base for the main features and functions. Of course s very important part is the resolution, (GUI) scaling and size management. The game is mainly developed for...
  11. M

    Setting a Position Relative to the Screen View?

    I want to keep an object at a specified position on the screen at any given time. This is the simplified script I have for a test object at the moment: x=view_xview[0]+1000; y=view_yview[0]+100; This works fine until the view in the room in extended. Here is the location of the object before...
  12. M

    GameMaker Drawing to the center of a view

    I'm trying to draw a sprite in the center of the view after the player dies. ie Game Over I've looked through the manual, more than once, and have tried working with both cameras and views. I can get the sprite to draw to any co-ordinates in the room or be affixed to the player, but neither of...
  13. Kaliam

    3D GMS2: Drawing 3D sprites to a surface like they are drawn to the application surface

    Hello, so this is a particularly specific problem but I will do my best to explain. Essentially, my project uses 3D vertices to draw sprites to the screen at different depths. Currently I am using a simple 2D normal map shader to light the sprites drawn to the screen in 3D. Each sprite has a...
  14. Y

    changing viewport with mouse movement

    so I just found out how to use an event (in this case left global mouse button pressed) to change the viewport but I want to be able to click on the screen and then move the viewport along with my mouse is only has to be on the y-axis. is this possible and how would I go at it?
  15. W

    GameMaker Score that follows camera

    Hello I am new to GMS2, and am programming a sonic game for a programming project. The last thing I need to do is to show the score, but I need it follow the view. I don't know what code I need or where to put it. I have created an invisible, non-solid object with the following code: x=...
  16. T

    GameMaker Viewports/Camera wont work?

    I have looked into this a bit and dont really know what is going on. Every time I try to run the game with viewports turned on, This happens: This is what the camera looks like in the level: And this is what the settings are: Also, small side-note, I dont know if anyone would even...
  17. G

    GameMaker Dynamic viewport/zoom level that expands with player exploration

    Hey all, I am making a Zelda-like and we're going for a special exploration effect on the camera. I'd like the viewport to expand to encompass the entire area of the room that the player has explored, essentially a bounding box around the path the player has taken through the room. It seems...
  18. A

    GameMaker [SOLVED] x and y of the currently visible part of the room

    I'm working on a platformer. I have a big room - 2x3 screens in size. The camera (or the view) (or them both) is following the character. (this camera/view thing is super confusing... I read and read again, but I don't understand it... To me it's either views or cameras... I don't know why they...
  19. 0

    Question - Code What is the relationship between view, view port, camera, and room?

    What is the exact relationship between a view, view port, camera, and room? I'm especially confused about the difference between a view and a view port. I can't find any explicit documentation about the differences. Also, what exactly is a view, compared to a view port or camera? Any help is...
  20. skeddles

    [solved] Making view size match window size causes weird bug when made bigger than initial size

    Trying to make the sprites in my game always display at the same size no matter how big the window is. I allow the player to resize the window. Code: step event: view_wview = window_get_width(); view_hview = window_get_height(); Looks fine at first: Resizing down looks perfect, but when...
Top