Tag Info

New answers tagged


Or for people using XNA when the system is flipped. First calculate the mouse cursor in the world. Since the mouse position system in XNA is flipped subtract the mouse Y from the height of the screen. var mouseinWorld = new Vector2( (cursor.X * oldZoomLevel) - world.X, ((cursor.Y - screen.Height) * oldZoomLevel) + world.Y)); Now change your ...


Zooming by setting the Z-Position. Obtain the Z-Position value by using transform.position.z, and then make a if-condition to declare when the different modes you would like to show. private float maxZoomIn = 5.0f; void Update() { zoom(); checkZoomState(); } void zoom() { //Simple zooming mechanics if(transform.position.z >= maxZoomIn) ...


If you are interested in doing a hex map you should definitely check out this http://www.redblobgames.com/grids/hexagons/ It coves few different methods of storing hex grids as well as basic operations like distance, fov, rotation and many more. It also describes how to do mapping from screen coordinates to hex coordinates and vice versa.


All three uniform 2D grids can be stored in a rectangular grid, you just have to scale and shear it to fit the one you're aiming for. To know what regions you need to load just transform the viewport extents to the data's coordinate system.

Top 50 recent answers are included