Page 1 of 1

Moving the view to other coordinates (case solved)

PostPosted: Fri Jun 02, 2006 5:39 am
by Diana Kennedy
I used this code on mouse button down:

Code: Select all
view. x = -2450;
view.y = 1204;


This sort of code worked well in antother game I made, but not in this one. The view jumps indeed, but t a totally different location. I don't know even where exactly, it's just black space. I checked and double checked : -the coordinates are right. Is there any possible explanation why this happens? Is threre an other, maybe more reliavle way to move the view?

Ok - ok forget it! Case solved! I made mistake in coordinates. Need some sleep! :oops: :oops:

PostPosted: Fri Jun 02, 2006 8:55 am
by Kodo
I found using coordinates to move the view around extremely frustrating, instead (as I think many other do) I simply use a filled region to mark the position then make the view go to that instead:

view.x = target_region_1.x;
view.y = target_region_1.y;

Using this method you never need to worry about actual numbers and you can just pull the target region around wherever and whenever you like, this makes it easier to change things around if you want to.

PostPosted: Fri Jun 02, 2006 9:05 am
by Diana Kennedy
good trick, Steve! Will try this out! Yeah, with those number-coordinates, its so frustrating. A little tiny error and the mess is perfect :)