Results 1 to 2 of 2

Thread: Centering a viewpoint around an object (2D)

  1. #1

    Thread Starter
    Frenzied Member Devion's Avatar
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    1,049

    Centering a viewpoint around an object (2D)

    I'm completely stumped on this prolly simple mathematic calculation.

    To sum things up:
    I got a viewpoint offset called Viewpoint.PosX and I've got an object onscreen with the variables Player.PosX, Player.PosY. Now the Y variables don't matter much in this case.

    Both X offsets can go from 1 to 4000.

    The limits are that the Viewpoint will not go further then 3200 as 800 is deducated to make sure the viewpoint doesn't go off screen.

    What's a good way to center the viewpoint around the object?

    Now I'm off to get some well deserved coffee -.-

  2. #2
    Frenzied Member David.Poundall's Avatar
    Join Date
    Sep 2002
    Location
    Robin Hood Land
    Posts
    1,457

    Re: Centering a viewpoint around an object (2D)

    You need to have a play with this code maybe..
    David

    Learn the Rules so that you know how to break them properly.

    Printing dll dBTools MZTools Winsock API WinsockVB More Winsock SGrid2 MSChart Mail2Web

    If you have found this thread useful then read this

Posting Permissions

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



Click Here to Expand Forum to Full Width