• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

center

  1. AnnoyingDoggoX

    Centering draw_text

    How would I get the x and y of the center of an object? I tried some things on my own and did some research but I couldn't find anything. Sorry if it's really simple.
  2. Axl Trauts

    SOLVED Get center of every children of Parent_Enemy instance

    Hi, I have a top down shooter and I have this special gun that shoots sticky bombs from above. The should appear at the middle of every enemy instance using its parent par_Enemy. Each enemy has different origins due to their unique behaviors, so using something like this on the script that...
  3. A

    Geometric issues

    Hello, This is my problem : The player in my game is represented with an arrow wich has its center defined at the bottom of it and in my code i would like to refer to the top the arrow. I can't use x + .../ y + ... because the direction of the arrow is always changing. I've tried with the...
  4. R

    GameMaker Center + clamp camera on zoom

    Hello all, I am fairy new to GameMaker, and I am playing around, trying to create my first platformer following Shaun Spalding's tutorials, especially this one regarding player camera tracking. I am using GameMaker Studio 2 on a Mac. I am trying to use a similar approach to allow smooth...
  5. H

    Legacy GM How to make object always follow the view center

    Hello! I am having trouble centering an object to the absolute center of my view in a room. The object needs to always be in the center of the view, even if the view is different between rooms. I am doing this for a menu object, which looks like this; Any help would be much appreciated...
  6. M

    GameMaker how to set object to go center of the camera?

    Hey I want my an object to go center of the camera. I tried this but it is not working. :( I am using Gamemaker studio 2 x = (camera_get_view_x(view_camera[0]) + camera_get_view_width(view_camera[0]))/2; y = (camera_get_view_y(view_camera[0]) + camera_get_view_height(view_camera[0]))/2;
  7. D

    Destroy object once you reach the center of it??

    I've been trying to do this for a few hours and can't find the problem :/ the object just acts as a solid when i run my destroy code.. Can anyone help me ? ///collision mid //horizontal //right if sign(hspeed) =1 {if place_meeting(x-6,y,obj_grass1) instance_destroy(); } else //left if...
  8. M

    Problems with centered text (android)

    Hey I hope you can help as I am at a loss. I have looked at two google results with similar issues, but I cannot post links so you gotta do without. I have an object that I use to spawn text that I want to show centered in the middle of the screen. In the draw event...
  9. M

    Problems with centering text (on android)

    Hey I hope you can help as I am at a loss. I have looked at this: https://forum.yoyogames.com/index.php?threads/cannot-align-text-horizontally.13078/ and this: http://stackoverflow.com/questions/22043775/how-to-draw-a-text-in-center-on-android-game-maker-studio and I still cannot find a...
  10. C

    Legacy GM Click on an object and display another in the center of the view, resized to fit the view.

    Also, when clicking on the resized object, make it disappear or go back to the inital one. I'm poorly trying to code for windows. (I know. I am a total noob. I've downloaded this a week ago and I know 0 things about coding.) How do I do that? Preferably with functions and variables, not exact...
  11. R

    How to fix centering my drawn menu with for loop

    I've a pixelart game so I've made a pixel perfect script which works. the viewport stays the same. If I push 0,1,2,3 the view changes so the viewport is upscalling correctly. However when I tried to center my for loop drawn menu. draw_set_halign(fa_center); draw_set_halign(fa_middle)...
  12. L

    Legacy GM How to find the center of a view

    I'm surprised myself I don't how to do this exactly. Let's say I have a view following the player, and when I press the Z key, I want something to pop up in the exact middle of the screen. Now if the view is a 640x480, of course I can just do, instance_create( view_xview+320...
Top