• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# dfMouseEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中dfMouseEventArgs的典型用法代码示例。如果您正苦于以下问题:C# dfMouseEventArgs类的具体用法?C# dfMouseEventArgs怎么用?C# dfMouseEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



dfMouseEventArgs类属于命名空间,在下文中一共展示了dfMouseEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OnMouseMove

    public void OnMouseMove( dfControl control, dfMouseEventArgs args )
    {
        if( animating || !dragging )
            return;

        this.momentum = ( momentum + args.MoveDelta.Scale( 1, -1 ) ) * 0.5f;

        args.Use();

        if( args.Buttons.IsSet( dfMouseButtons.Left ) )
        {

            var ray = args.Ray;
            var distance = 0f;
            var direction = Camera.main.transform.TransformDirection( Vector3.back );
            var plane = new Plane( direction, lastPosition );
            plane.Raycast( ray, out distance );

            var pos = ( ray.origin + ray.direction * distance ).Quantize( control.PixelsToUnits() );
            var offset = pos - lastPosition;

            var transformPos = ( control.transform.position + offset ).Quantize( control.PixelsToUnits() );
            control.transform.position = transformPos;

            lastPosition = pos;

        }
    }
开发者ID:dashqasar,项目名称:GoogleMap,代码行数:28,代码来源:TouchThrow.cs


示例2: OnMouseDown

    public void OnMouseDown( dfControl source, dfMouseEventArgs args )
    {
        if( State == dfGestureState.Possible )
        {

            var elapsed = Time.realtimeSinceStartup - StartTime;
            if( elapsed <= timeout && Vector2.Distance( args.Position, StartPosition ) <= maxDistance )
            {

                StartPosition = CurrentPosition = args.Position;

                State = dfGestureState.Began;

                if( DoubleTapGesture != null ) DoubleTapGesture( this );
                gameObject.Signal( "OnDoubleTapGesture", this );

                endGesture();

                return;

            }

        }

        StartPosition = CurrentPosition = args.Position;
        State = dfGestureState.Possible;
        StartTime = Time.realtimeSinceStartup;
    }
开发者ID:BjarkeHou,项目名称:ProjectGuard,代码行数:28,代码来源:dfDoubleTapGesture.cs


示例3: OnClick

    public void OnClick(dfControl control, dfMouseEventArgs mouseEvent)
    {

        Ship.PlayerController.pHull hull;
        switch(shipSelect.selectedIndex)
        {
            case 0:
                hull = Ship.PlayerController.pHull.Viper;
                GameManager.Instance.initializeShip(hull);
                break;
            case 1:
                hull = Ship.PlayerController.pHull.Anvil;
                GameManager.Instance.initializeShip(hull);
                break;
            case 2:
                hull = Ship.PlayerController.pHull.Shark;
                GameManager.Instance.initializeShip(hull);
                break;
            case 3:
                hull = Ship.PlayerController.pHull.Marauder;
                GameManager.Instance.initializeShip(hull);
                break;
            case 4:
                hull = Ship.PlayerController.pHull.Vulture;
                GameManager.Instance.initializeShip(hull);
                break;

        }
        Application.LoadLevel("CustomizeShip");
    }
开发者ID:TobyDGosselin,项目名称:Star-Sector,代码行数:30,代码来源:ConfirmHull.cs


示例4: OnMouseDown

 protected void OnMouseDown( dfControl source, dfMouseEventArgs args )
 {
     StartPosition = CurrentPosition = args.Position;
     State = dfGestureState.Possible;
     StartTime = Time.realtimeSinceStartup;
     hoverTime = Time.realtimeSinceStartup;
 }
开发者ID:kvelury,项目名称:apocalyptia,代码行数:7,代码来源:dfFlickGesture.cs


示例5: OnMouseHover

	public void OnMouseHover( dfControl control, dfMouseEventArgs mouseEvent )
	{

		if( isTooltipVisible )
			return;

		var isSpellSlot = actionBar.Controls.Contains( mouseEvent.Source );
		if( isSpellSlot )
		{

			target = mouseEvent.Source;
			if( target == lastTarget )
				return;

			lastTarget = target;

			isTooltipVisible = true;

			var slot = target.GetComponentInChildren<SpellSlot>();
			if( string.IsNullOrEmpty( slot.Spell ) )
				return;

			var spell = SpellDefinition.FindByName( slot.Spell );
			if( spell == null )
				return;

			ActionbarsTooltip.Show( spell );

		}
		else
		{
			lastTarget = null;
		}

	}
开发者ID:RainbowMin,项目名称:U3D_Match3,代码行数:35,代码来源:ActionbarsHoverEvents.cs


示例6: OnClick

    public void OnClick( dfControl sender, dfMouseEventArgs args )
    {
        // No need to do anything unless an actual item was clicked
        if( args.Source == container )
            return;

        // Do not process click event if the user was scrolling by
        // dragging the mouse. Not needed for mobile.
        if( Vector2.Distance( args.Position, touchStartPosition ) > 20 )
            return;

        // Find highest-level control containing the click
        var source = args.Source;
        while( source != null && !controls.Contains( source ) )
        {
            source = source.Parent;
        }

        // If an item in the scroller was clicked, select it
        if( source != null )
        {

            // Select the clicked item
            lastSelected = -1;
            setSelectedIndex( controls.IndexOf( source ) );

            // Do not need to try to select "most centered" item
            isMouseDown = false;

        }
    }
开发者ID:kvelury,项目名称:apocalyptia,代码行数:31,代码来源:dfCoverflow.cs


示例7: OnMouseMove

    public void OnMouseMove( dfControl source, dfMouseEventArgs args )
    {
        if( State == dfGestureState.Possible )
        {
            if( Vector2.Distance( args.Position, StartPosition ) >= minDistance )
            {

                State = dfGestureState.Began;

                CurrentPosition = args.Position;
                Delta = args.Position - StartPosition;

                if( PanGestureStart != null ) PanGestureStart( this );
                gameObject.Signal( "OnPanGestureStart", this );

            }
        }
        else if( State == dfGestureState.Began || State == dfGestureState.Changed )
        {

            State = dfGestureState.Changed;

            Delta = args.Position - CurrentPosition;
            CurrentPosition = args.Position;

            if( PanGestureMove != null ) PanGestureMove( this );
            gameObject.Signal( "OnPanGestureMove", this );

        }
    }
开发者ID:AhrenLi,项目名称:2048,代码行数:30,代码来源:dfPanGesture.cs


示例8: OnMouseDown

    public void OnMouseDown( dfControl control, dfMouseEventArgs args )
    {
        if( !args.Used && args.Buttons == dfMouseButtons.Middle )
        {

            if( contextMenu.IsOpen )
            {
                contextMenu.Close();
                return;
            }

            args.Use();

            var hitPosition = control.GetHitPosition( args );
            var host = contextMenu.host;

            host.RelativePosition = hitPosition - host.Size * 0.5f;
            host.BringToFront();
            host.Show();
            host.Focus();

            contextMenu.Open();

        }
    }
开发者ID:jscott1989,项目名称:public-access-wars,代码行数:25,代码来源:RadialContextMenu.cs


示例9: OnMouseMove

    protected internal override void OnMouseMove( dfMouseEventArgs args )
    {
        args.Use();

        if( args.Buttons.IsSet( dfMouseButtons.Left ) )
        {

            var ray = args.Ray;
            var distance = 0f;
            var direction = GetCamera().transform.TransformDirection( Vector3.back );
            var plane = new Plane( direction, lastPosition );
            plane.Raycast( ray, out distance );

            var pos = ( ray.origin + ray.direction * distance ).Quantize( parent.PixelsToUnits() );
            var offset = pos - lastPosition;

            var transformPos = ( parent.transform.position + offset ).Quantize( parent.PixelsToUnits() );
            parent.transform.position = transformPos;

            lastPosition = pos;

        }

        base.OnMouseMove( args );
    }
开发者ID:AhrenLi,项目名称:2048,代码行数:25,代码来源:dfDragHandle.cs


示例10: OnMouseDown

 public void OnMouseDown( dfControl source, dfMouseEventArgs args )
 {
     StartPosition = CurrentPosition = args.Position;
     State = dfGestureState.Possible;
     StartTime = Time.realtimeSinceStartup;
     Delta = Vector2.zero;
 }
开发者ID:AhrenLi,项目名称:2048,代码行数:7,代码来源:dfPanGesture.cs


示例11: OnMouseMove

 public void OnMouseMove( dfControl control, dfMouseEventArgs mouseEvent )
 {
     if( mouseEvent.Buttons == dfMouseButtons.Left )
     {
         updateHotspot( mouseEvent );
     }
 }
开发者ID:kvelury,项目名称:apocalyptia,代码行数:7,代码来源:ColorFieldSelector.cs


示例12: OnClick

 void OnClick( dfControl sender, dfMouseEventArgs args )
 {
     if( SelectOnClick != null )
     {
         SelectOnClick.Focus();
     }
 }
开发者ID:haozi000005,项目名称:happy2d,代码行数:7,代码来源:ControlNavigation.cs


示例13: HelpClicked

    public void HelpClicked(dfControl control, dfMouseEventArgs args)
    {
        args.Use();
        TextAsset description = Resources.Load<TextAsset>("Descriptions/" + bi.className);
        GameObject prefab = (GameObject)Resources.Load("Prefabs/Buildings/" + bi.className);

        Dialog.Instance.SetDialog(bi.buildingName, description.text, "Continue", true, false,prefab);
    }
开发者ID:jackmott,项目名称:solescape,代码行数:8,代码来源:HelpButton.cs


示例14: OnClick

 public void OnClick( dfControl control, dfMouseEventArgs mouseEvent )
 {
     if( colorField != null )
     {
         colorField.Hue = HSBColor.GetHue( control.Color );
         colorField.SelectedColor = control.Color;
     }
 }
开发者ID:kvelury,项目名称:apocalyptia,代码行数:8,代码来源:ColorPickerPreset.cs


示例15: UI_Button_NewGame_Click

    /// <summary>
    /// Starts a new game
    /// </summary>
    /// <param name="s">Button</param>
    /// <param name="e">Mouse events</param>
    /// <remarks>
    /// <para>
    /// Only hides the main menu and displays the New Game UI
    /// </para>
    /// </remarks>
    public void UI_Button_NewGame_Click(dfControl s, dfMouseEventArgs e)
    {
        //Show the New Game UI
        uim.HideUI(UIManager.UIELEMENTS.MainMenu);
        uim.ShowUI(UIManager.UIELEMENTS.NewGameUI);


    }
开发者ID:kidaa,项目名称:ProjectUniverse,代码行数:18,代码来源:MainMenuPanelManager.cs


示例16: OnMouseHover

 public void OnMouseHover( dfControl source, dfMouseEventArgs args )
 {
     if( State == dfGestureState.Possible && Time.realtimeSinceStartup - hoverTime >= timeout )
     {
         StartPosition = CurrentPosition = args.Position;
         StartTime = Time.realtimeSinceStartup;
     }
 }
开发者ID:BjarkeHou,项目名称:ProjectGuard,代码行数:8,代码来源:dfFlickGesture.cs


示例17: OnClick

 public void OnClick(dfControl control, dfMouseEventArgs mouseEvent)
 {
     rm.enabled = true;
     rm.Close();
     ManualTargetingControls.mtc.cancelAllTurrets();
     Label.Display("Target Weapon");
     Hide();
 }
开发者ID:TobyDGosselin,项目名称:Star-Sector,代码行数:8,代码来源:closeButton.cs


示例18: OnClick

 public void OnClick( dfControl control, dfMouseEventArgs mouseEvent )
 {
     if(UILogger.UILog.ContainsKey(this.name)) {
         UILogger.UILog[this.name]++;
     } else {
         UILogger.UILog.Add(this.name,1);
     }
     UILogger.ButtonsPressed.Add(this.name);
 }
开发者ID:CoryBerg,项目名称:drexelNeonatal,代码行数:9,代码来源:UIButtonLogger.cs


示例19: OnClick

    void OnClick( dfControl sender, dfMouseEventArgs args )
    {
        #if UNITY_EDITOR
        if( Application.isEditor )
            UnityEditor.EditorApplication.isPlaying = false;
        #endif

        Application.Quit();
    }
开发者ID:kvelury,项目名称:apocalyptia,代码行数:9,代码来源:DemoQuitOnClick.cs


示例20: OnClick

    public bool loadNext = false; // load the next scenario instead of the one specified.

    #endregion Fields

    #region Methods

    public void OnClick( dfControl control, dfMouseEventArgs mouseEvent )
    {
        if(loadNext) {
            CaseHandler.Instance.ActivateNext();
        } else {
            CaseHandler.Instance.ActivateCase(CaseType);
        }
        Application.LoadLevel("IntroRespCase");
    }
开发者ID:CoryBerg,项目名称:drexelNeonatal,代码行数:15,代码来源:SetScenarioAndLoad.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# dfRenderData类代码示例发布时间:2022-05-24
下一篇:
C# dfMarkupStyle类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap