当前位置: 首页>>代码示例>>C#>>正文


C# View.Zoom方法代码示例

本文整理汇总了C#中SFML.Graphics.View.Zoom方法的典型用法代码示例。如果您正苦于以下问题:C# View.Zoom方法的具体用法?C# View.Zoom怎么用?C# View.Zoom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SFML.Graphics.View的用法示例。


在下文中一共展示了View.Zoom方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Init

 public override void Init(Entity entity)
 {
     base.Init(entity);
     camera = new View(Target.Transform.Position, Global.Screen);
     camera.Zoom(2f);
     //camera.Rotate(45f);
 }
开发者ID:nikibobi,项目名称:LD26-fail,代码行数:7,代码来源:Camera.cs

示例2: Initialize

        public void Initialize()
        {
            world = (LayeredWorld)WorldManager.Worlds["first_world"];

            view = new View(new Vector2f(100, 0), new Vector2f(50, 50));
            view.Zoom(10);

            player = new Player(world.PlayerStartPosition);

            Program.RenderWindow.KeyPressed += RenderWindow_KeyPressed;
        }
开发者ID:Chiheb2013,项目名称:GameLibs,代码行数:11,代码来源:TopViewMapState.cs

示例3: draw

        public void draw(RenderWindow win, View view)
        {
            if (resetView)
            {
                view.Center = Vector2.Zero;
                view.Zoom(100F / view.Size.Y);
                resetView = false;
            }
            win.Draw(bg);

            Map.Draw(win);
            AlignmentManager.Draw(win);
            ParticleManager.Draw(win);
            EnemyManager.Draw(win);
            Player.Draw(win);
        }
开发者ID:Greaka,项目名称:RuneShift,代码行数:16,代码来源:InGameState.cs

示例4: RefreshView

        void RefreshView()
        {
            View v = new View(new FloatRect(cameraX, cameraY, Width, Height));

            v.Rotation = -cameraAngle;
            v.Zoom(1 / cameraZoom);
            RenderTarget.SetView(v);
        }
开发者ID:Kotvitskiy,项目名称:AoS,代码行数:8,代码来源:Surface.cs

示例5: SfmlControl_Resize

        void SfmlControl_Resize(object sender, EventArgs e)
        {
            Vector2f size = new Vector2f(1920f, 1080f);
            SFML.Graphics.View v = new SFML.Graphics.View(m_currentViewPosition, size);
            v.Zoom(m_currentZoom);

            float windowRatio = (float)this.Size.Width / (float)this.Size.Height;
            float viewRatio = 16f / 9f;
            float sizeX = 1f;
            float sizeY = 1f;
            float posX = 0f;
            float posY = 0f;

            bool horizontalSpacing = (windowRatio > viewRatio);

            if (horizontalSpacing)
            {
                sizeX = viewRatio / windowRatio;
                posX = (1f - sizeX) / 2f;
            }
            else
            {
                sizeY = windowRatio / viewRatio;
                posY = (1f - sizeY) / 2f;
            }
            v.Viewport = new FloatRect(posX, posY, sizeX, sizeY);

            m_renderWindow.SetView(v);
        }
开发者ID:John-Chan,项目名称:crush,代码行数:29,代码来源:SfmlControl.cs

示例6: UpdateDraw

        private static void UpdateDraw(RenderWindow window)
        {
            cameraPos = new Vector2f((int)clientPlayer.position.X, (int)clientPlayer.position.Y);
            camera2D = new View(cameraPos, new Vector2f(640, 480));
            camera2D.Zoom(.5f);
            View noCamera = new View(new Vector2f(0, 0), new Vector2f(640, 480));

            window.SetView(camera2D);

            UpdateSounds();

            window.DispatchEvents();
            window.Clear(Color.Black);

            for (int i = 0; i < connectedPlayers.Count; i++)
            {
                connectedPlayers[i].connectColor = Color.White;
            }

            //window.Draw(background);
            window.Draw(basicLevelDec);


            HandleMessages();

            Text _chatCompose = new Text(clientPlayer.textCapture, font);
            float chatScale = .4f;
            _chatCompose.Scale = new Vector2f(chatScale, chatScale);
            _chatCompose.Position = new Vector2f(-300, 200);// clientPlayer.position;

            Text _textConnected = new Text(connected ? "CONNECTED" : "DISCONNECTED", font);
            _textConnected.Scale = new Vector2f(chatScale, chatScale);
            _textConnected.Position = new Vector2f(-300, -230);// clientPlayer.position;



            Text _playersConnectedText = new Text(connectedPlayers.Count + " Player Connected", font);
            _playersConnectedText.Scale = new Vector2f(chatScale, chatScale);
            _playersConnectedText.Position = new Vector2f(-300, -220);// clientPlayer.position;



            drawPlayers();
            updatePlayers();


            window.SetView(noCamera);
            window.Draw(_chatCompose);
            window.Draw(_textConnected);
            window.Draw(_playersConnectedText);

            Color pingColor = Color.White;

            if (ping == 0)
            {
                //connected = false;
                pingColor = Color.Red;
            }
            if (ping > 100)
            {
                pingColor = Color.Yellow;
            }

            Render.drawString(font, ping + " ms", new Vector2f(-300, -240), pingColor, .4f, false);

            for (int i = 0; i < chatMessages.Count; i++)
            {
                Text chatMessage = new Text(chatMessages[i], font);
                chatMessage.Scale = new Vector2f(chatScale, chatScale);
                chatMessage.Position = new Vector2f(-300, -200 + (i * 10));// clientPlayer.position;

                window.Draw(chatMessage);
            }




            window.Display();
        }
开发者ID:libjared,项目名称:jaunt,代码行数:79,代码来源:Program.cs

示例7: CameraManager

 public CameraManager(Game game)
 {
     _game = game;
     _worldView = new View(new Vector2f(0, 0), new Vector2f(800, 600));
     _worldView.Zoom(1f / 32f);
 }
开发者ID:klutch,项目名称:SFMLFarseerNetwork,代码行数:6,代码来源:CameraManager.cs

示例8: CameraSystem

 public CameraSystem()
 {
     _worldView = new View(new Vector2f(0, 0), new Vector2f(Game.window.DefaultView.Size.X, Game.window.DefaultView.Size.Y));
     _worldView.Zoom(1f / ORIGINAL_SCALE);
 }
开发者ID:klutch,项目名称:Loderpit,代码行数:5,代码来源:CameraSystem.cs


注:本文中的SFML.Graphics.View.Zoom方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。