1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

GM:S 1.4 difference between coordinates

Discussion in 'Programming' started by Shadowblitz16, Jun 28, 2016.

  1. Shadowblitz16

    Shadowblitz16 Member

    Joined:
    Jun 23, 2016
    Posts:
    601
    does anybody know the difference between the draw gui event coordinates and the draw event coordinates?

    is there a way to convert between them?
    is there a way to make myself a statement that automatically converts between them depending on the view?
     
  2. Jakylgamer

    Jakylgamer Member

    Joined:
    Jun 27, 2016
    Posts:
    511
    think of the gui as a surface that is already following the view (not really following it but rather is the window itself), but there are ways to make the drawn buttons clickable if thats what youre wanting to do.
     
  3. SyntaxError

    SyntaxError Member

    Joined:
    Jun 20, 2016
    Posts:
    81
    Also, display_mouse_get_x maybe helpful if I'm imagining (assuming) what you need this info for.
     
  4. Shadowblitz16

    Shadowblitz16 Member

    Joined:
    Jun 23, 2016
    Posts:
    601
    well I downloaded this
    and I was trying to align and stretch it to the bottom of the view

    I wanted to use maxwinapi2 but I guess it was outdated which is weird since I didn't have any import errors
     
    Last edited: Jun 28, 2016
  5. Paolo Mazzon

    Paolo Mazzon Guest

    Draw gui is directly to the screen (ie; the window, or monitor in fullscreen) while the draw event is drawing to the game world (And thus, fabricated by views/any scaling methods you have).

    So the coordinates 32,32 in draw gui mean 32,32 on the game window, while 32,32 in the draw event mean 32,32 in the game world. How you convert between the two will be specialized to any scaling methods/views you have implemented.
     
    Snail Man likes this.
  6. Shadowblitz16

    Shadowblitz16 Member

    Joined:
    Jun 23, 2016
    Posts:
    601
    well I've tried scaling it by subtracting it from various view functions
    but it doesn't seem to work

    hmm for some reason it seems to be drawing like in opposite coordinates
    I am drawing it with the code

    Code:
    gui_draw(gui, view_wview-mouse_x, view_hview-mouse_y)
    
    but when I move my mouse left it moves right
    and when I move my mouse right it moves left
    same with the vertical axis

    I don't think its the extension
    is it possible for the draw gui event to do this?
     
    Last edited: Jun 28, 2016
  7. obscene

    obscene Member

    Joined:
    Jun 21, 2016
    Posts:
    2,468
    Not reading about the entire issue here, but just on your last post about the reversal...

    mouse_x-view_wview, mouse_y-view_hview
     
  8. Shadowblitz16

    Shadowblitz16 Member

    Joined:
    Jun 23, 2016
    Posts:
    601
    @obscene ok that fixed the reversal
    however it seems my gui isn't drawing to the mouse position exactly
    it seems to be desynced with my mouse aka moving slower then it

    I think there is something still with the gui draw event and the actual position of the mouse
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice