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


C# ControlState类代码示例

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


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

示例1: TacticalBattle

        public ControlState controlState;                //get and set the control state
        #endregion

        #region constructor/load
        public TacticalBattle(List<Piece> player1Army, List<Piece> player2Army, TacMap map, ContentManager content)
        {
            //p1Avatar = player1;
            //p2Avatar = player2;

            this.player1Army = player1Army;
            this.player2Army = player2Army;

            isPlayer1Turn = true;
            this.map = map;
            battleOver = false;
            gridOn = false;

            mouseVisible = true;
            controlState = ControlState.selectUnit;

            selectedUnit = null;
            status = "Combat begins";
            selectionTiles = new List<Tile>();
            unitInfo = "";
            //load interface items                  TODO
            confirmation = content.Load<Texture2D>("confirmationPopup");
            background = content.Load<Texture2D>("TerrainSprites/battle");
            statusFont = content.Load<SpriteFont>("Arial");
            playerFont = content.Load<SpriteFont>("playerFont");
            infoFont = content.Load<SpriteFont>("infoFont");
            moveBox = content.Load<Texture2D>("TerrainSprites/move");
            targetBox = content.Load<Texture2D>("TerrainSprites/target");
            selectedBox = content.Load<Texture2D>("TerrainSprites/selected");
            horizontal = content.Load<Texture2D>("TerrainSprites/horizontal");
            vertical = content.Load<Texture2D>("TerrainSprites/vertical");
            winBox = content.Load<Texture2D>("Menu/Win message");
            //set units to starting positions
            startingPositions();
        }
开发者ID:Risab,项目名称:dawn-of-conquest,代码行数:39,代码来源:TacticalBattle.cs

示例2: LoadEditor

 public void LoadEditor(IProperties imageServiceSettings)
 {
     _loadedState = ControlState.Loading;
     _imageServiceSettings = imageServiceSettings;
     LoadEditor();
     _loadedState = ControlState.Loaded;
 }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:7,代码来源:ImageServiceSettingsEditor.cs

示例3: Update

    // Update is called once per frame
    void Update()
    {
        switch(controlState){
            case ControlState.DEBUG:
                Vector2 mouse = Input.mousePosition;
                float h = mouse.x / cam.pixelWidth;
                float v = (cam.pixelHeight - mouse.y)/cam.pixelHeight ;

                //Script used for detecting if controller should be used
                transform.rotation = Quaternion.Euler(v * verticalRotationAmount + verticalRotationOffset,h * horizontalRotationAmount + horizontalRotationOffset,0);

            break;
            case ControlState.NVR:
                controllerRotX += (Input.GetAxis("ViewY") * turnSpeed * Time.deltaTime);
                controllerRotY += (Input.GetAxis("ViewX") * turnSpeed * Time.deltaTime);

                controllerRotX = Mathf.Clamp(controllerRotX,-90,90);

                transform.rotation = Quaternion.Euler(controllerRotX,controllerRotY + cartOffsetRotY,0);
            break;
            case ControlState.VR:
                transform.rotation = Quaternion.Euler(0,cartOffsetRotY - 180,0);
            break;
        }

        if(Input.GetKeyDown("c")){
            if((int)++controlState % 3 == 0)
                controlState = ControlState.DEBUG;
                Console.Instance.AddMessage("ControlState: " + controlState);
                Debug.Log("ControlState: " + controlState);
        }
    }
开发者ID:Jalict,项目名称:MED5-PGP-P1,代码行数:33,代码来源:HeadControl.cs

示例4: LoadEditor

 public void LoadEditor(IImageUploadSettingsEditorContext context)
 {
     _loadedState = ControlState.Loading;
     _context = context;
     LoadEditor();
     _loadedState = ControlState.Loaded;
 }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:7,代码来源:ImageFileUploadSettingsEditor.cs

示例5: Update

        public void Update(TimeSpan elapsedTime, ControlState controlState)
        {
            var leftRight = this.helpSteer(controlState).Clamped(-1, 1);

            this.updateMovement(elapsedTime, controlState.Acceleration, leftRight);

            this.update();
        }
开发者ID:amulware,项目名称:ld33,代码行数:8,代码来源:CentiHead.cs

示例6: PaintScrollBarThumbEventArgs

 public PaintScrollBarThumbEventArgs(System.Drawing.Graphics graphics, Rectangle thumbRect, ControlState controlState, System.Windows.Forms.Orientation orientation, bool enabled)
 {
     this._graphics = graphics;
     this._thumbRect = thumbRect;
     this._controlState = controlState;
     this._orientation = orientation;
     this._enabled = enabled;
 }
开发者ID:jxdong1013,项目名称:archivems,代码行数:8,代码来源:PaintScrollBarThumbEventArgs.cs

示例7: PaintScrollBarThumbEventArgs

 public PaintScrollBarThumbEventArgs(
     Graphics graphics,
     Rectangle thumbRect,
     ControlState controlState,
     Orientation orientation)
     : this(graphics, thumbRect, controlState, orientation, true)
 {
 }
开发者ID:panshuiqing,项目名称:winform-ui,代码行数:8,代码来源:PaintScrollBarThumbEventArgs.cs

示例8: Blend

        public ColorValue[] States; // Modulate colors for all possible control states

        #endregion Fields

        #region Methods

        /// <summary>Blend the colors together</summary>
        public void Blend(ControlState state, float elapsedTime, float rate)
        {
            if ((States == null) || (States.Length == 0) )
                return; // Nothing to do

            ColorValue destColor = States[(int)state];
            Current = ColorOperator.Lerp(Current, destColor, 1.0f - (float)Math.Pow(rate, 30 * elapsedTime) );
        }
开发者ID:JeremiahZhang,项目名称:AKA,代码行数:15,代码来源:dxmutgui.cs

示例9: PaintScrollBarArrowEventArgs

 public PaintScrollBarArrowEventArgs(System.Drawing.Graphics graphics, Rectangle arrowRect, ControlState controlState, System.Windows.Forms.ArrowDirection arrowDirection, System.Windows.Forms.Orientation orientation, bool enabled)
 {
     this._graphics = graphics;
     this._arrowRect = arrowRect;
     this._controlState = controlState;
     this._arrowDirection = arrowDirection;
     this._orientation = orientation;
     this._enabled = enabled;
 }
开发者ID:jxdong1013,项目名称:archivems,代码行数:9,代码来源:PaintScrollBarArrowEventArgs.cs

示例10: OnMouseEnter

 protected override void OnMouseEnter(EventArgs e)
 {
     if (state != ControlState.Down)
     {
         state = ControlState.Hover; ;
     }
     this.Invalidate();
     base.OnMouseEnter(e);
 }
开发者ID:yienit,项目名称:KST,代码行数:9,代码来源:SkinItemButton.cs

示例11: LoadEditor

 public void LoadEditor(ImageDecoratorEditorContext context, object state, IImageTargetEditor imageTargetEditor)
 {
     _loadedState = ControlState.Loading;
     _context = context;
     _state = state;
     _imageTargetEditor = imageTargetEditor;
     LoadEditor();
     _loadedState = ControlState.Loaded;
     OnEditorLoaded();
 }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:10,代码来源:ImageDecoratorEditor.cs

示例12: PaintScrollBarArrowEventArgs

 public PaintScrollBarArrowEventArgs(
     Graphics graphics,
     Rectangle arrowRect,
     ControlState controlState,
     ArrowDirection arrowDirection,
     Orientation orientation)
     : this(graphics,
     arrowRect,
     controlState,
     arrowDirection,
     orientation,
     true)
 {
 }
开发者ID:panshuiqing,项目名称:winform-ui,代码行数:14,代码来源:PaintScrollBarArrowEventArgs.cs

示例13: StateHotspot

        public StateHotspot(ControlState representedState, Rectangle hotspotRect, bool selected, Image activeImage, Image inactiveImage)
        {
            //Setting what state the hotspot represents
            this.representedState = representedState;

            //Setting if it is currently selected
            this.selected = selected;

            //Setting the size and position of the hotspot
            this.hotspotRect = hotspotRect;

            //Setting the images it will use to display if it is active
            this.activeImage = activeImage;
            this.inactiveImage = inactiveImage;
        }
开发者ID:AlexanderMcNeill,项目名称:voxvisio,代码行数:15,代码来源:StateHotspot.cs

示例14: Update

		public void Update ()
		{
			if (stateChanged)
			{
				stateChanged = false;
				return;
			}
			if (_state == ControlState.Starting)
			{
				_state = ControlState.Active;
			}
			if (_state == ControlState.Ending)
			{
				_state = ControlState.Inactive;
			}
		}
开发者ID:raxter,项目名称:6-Fold-Mass-Production,代码行数:16,代码来源:InputCatcher.cs

示例15: SetControlState

 private void SetControlState(ControlState state)
 {
     switch (state)
     {
         case ControlState.TimerStopped:
             this.groupBoxStartTimers.Enabled = true;
             this.groupBoxControls.Enabled = false;
             break;
         case ControlState.TimerRunning:
             this.groupBoxStartTimers.Enabled = false;
             this.groupBoxControls.Enabled = true;
             break;
         default:
             break;
     }
 }
开发者ID:kihonkai,项目名称:basictimer,代码行数:16,代码来源:FormMain.cs


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