示例#1
0
        private async void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            if (!isInitialized)
            {
                //await Game.Instance.Initialize("Classic", "classic.xml");
                await Game.Instance.Initialize("WaW", "World_At_War.xml");

                MapViewer.ChangeView(0, 0, 0.4f);
                isInitialized    = true;
                this.DataContext = Game.Instance;
            }
        }
示例#2
0
        private void scrollViewer_MouseMoved(object sender, PointerRoutedEventArgs e)
        {
            e.Handled = true;
            if (mapClicked)
            {
                PointerPoint mousePoint = e.GetCurrentPoint(Map);
                double       curX       = MapViewer.HorizontalOffset;
                double       curY       = MapViewer.VerticalOffset;

                MapViewer.ChangeView(
                    curX - (mousePoint.Position.X - mouseClickOrigin.Position.X),
                    curY - (mousePoint.Position.Y - mouseClickOrigin.Position.Y),
                    MapViewer.ZoomFactor);
            }
        }