View Single Post
Old 05-05-10, 06:03 PM   #1685
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Here's the newest feature I'm working on. I call it user marks. Instead of the boring pencil adding X marks to the map I wanted something that I could add text to. So I created it. When you add a new user mark you're asked to type in the text for it. Then when you mouse over the user mark on the TAI a pop up shows with the text for it. It's taken me 2 days to just get this far on it and I'm stuck at one spot. As the game doesn't expose the current zoom level or what it does when you zoom/unzoom I have to figure out a way to make the user mark scale appropriately by zoom. In order to make this work I have the mousewheel disabled when you mouse in the TAI map. It becomes re-enabled when you mouse out. This had to be done since I can't read the current zoom level I have to force you to use the zoom and unzoom buttons in the bottom right of the TAI map. When you press those I can increment or decrement a counter to know which zoom level the TAI is in. My problem is this: I add a new user mark to the TAI map:


now all I know about this user mark are it's screen coordinates in the TAI. Now I want to zoom in. That would place me at the 1500m scale. So what mathematical formula would I use to scale the position of the user mark? I thought that since we went from 3000m to 1500m that I should double the value....nope, no way. So I tried dividing by 2...nope, no way again. I have to figure out the correct way to scale this point on the map when zooming/unzooming
TheDarkWraith is offline   Reply With Quote