Results 1 to 10 of 121

Thread: G.T.A.2 Map Editor

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #25
    In original editor when you hold down Shift key and right mouse button at the same time and move your mouse either up and down or left and right then you can zoom camera in and out.

    I move mouse up, camera zooming IN, i move mouse down, its zooming OUT.
    Also if i move mouse to the left its zooming in and if i move to the right, its zooming out.

    I tried to implement this in my editor but i dont understand how it calculates the zoom value according to mouse X,Y coords.
    I can make it work for either up/down or left/right but not for the both of them.

    Atm i can zoom in and out with mousewheel, but i would like to make it possible to zoom in / out without mousewheel also.
    Because i cant say something like:
    Code:
    camera.z=camera.z-mousex
    camera.z=camera.z-mousey
    also tried this in MouseMove event:
    Code:
    Editor.ZTranslate:=(editor.mx-x-y);
    Not good and not correct at all.
    Any ideas? How hard it can be?

    EDIT: Nvm, as usual, after posting question, the solution comes by "itself".
    mouse.c code here helped me:
    http://www.sgi.com/products/software...in32_tutorial/

    ZOOM feature was unused, i tried it and it did exactly what i needed. Ported the mouse coord saving (oldmousex, mousemove, mousedown etc ) to my editor and it works.

    How i found it? Googled for: zoom := zoom + mx; gltranslatef
    Last edited by hwnd; 21-03-2014 at 11:17 PM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •