How to set center of view at coordinates (x,y)

edited June 2016 in How To...

How do I get the page to be centered at whatever (x,y) coordinates of my choosing? I have a grid and objects moving along the grid. I would like to be able to isolate one of those objects, and make it so that at every refresh, the page is centered at that object's (x,y) coordinates.

Tagged:

Answers

  • Translate() is pretty useful.

  • I'm using translate, but it moves the entire figure, so it does not really highlight the object of interest. This is why I would like to fix this object's location as the center of the view.

  • If you know the x and y pos of the object of interest, you should be able to translate() to centre this each time you draw. Does the rest of it not move?

  • I got it working. Thanks for the help.!

Sign In or Register to comment.