在XNA C#(自定义框架)中制作具有惯性的可拖动地图

时间:2016-02-05 18:03:10

标签: c# dictionary xna drag panning

我正试图制作一张带有惯性,摩擦力的可拖动地图,我现在失去了 例: http://www.emanueleferonato.com/2016/01/18/how-to-create-a-html-draggable-and-scrollable-map-with-inertia-using-phaser-framework/

这是我到目前为止所做的:

 override public void update()
    {
        base.update();

        if (getState() == STATE_DRAGGING)
        {
            if (Input.Mouse.pressed())
            {

               setVelocityX(drag_x - Input.Mouse.getX());
            }
        }
        if (getState() == STATE_STALE)
        {

            if (CMouse.pressed())
            {
                drag_x = Input.Mouse.getX();
                drag_y = Input.Mouse.getY();
                setState(STATE_DRAGGING);

            }

        }}

0 个答案:

没有答案