本文整理汇总了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();
}
示例2: LoadEditor
public void LoadEditor(IProperties imageServiceSettings)
{
_loadedState = ControlState.Loading;
_imageServiceSettings = imageServiceSettings;
LoadEditor();
_loadedState = ControlState.Loaded;
}
示例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);
}
}
示例4: LoadEditor
public void LoadEditor(IImageUploadSettingsEditorContext context)
{
_loadedState = ControlState.Loading;
_context = context;
LoadEditor();
_loadedState = ControlState.Loaded;
}
示例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();
}
示例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;
}
示例7: PaintScrollBarThumbEventArgs
public PaintScrollBarThumbEventArgs(
Graphics graphics,
Rectangle thumbRect,
ControlState controlState,
Orientation orientation)
: this(graphics, thumbRect, controlState, orientation, true)
{
}
示例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) );
}
示例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;
}
示例10: OnMouseEnter
protected override void OnMouseEnter(EventArgs e)
{
if (state != ControlState.Down)
{
state = ControlState.Hover; ;
}
this.Invalidate();
base.OnMouseEnter(e);
}
示例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();
}
示例12: PaintScrollBarArrowEventArgs
public PaintScrollBarArrowEventArgs(
Graphics graphics,
Rectangle arrowRect,
ControlState controlState,
ArrowDirection arrowDirection,
Orientation orientation)
: this(graphics,
arrowRect,
controlState,
arrowDirection,
orientation,
true)
{
}
示例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;
}
示例14: Update
public void Update ()
{
if (stateChanged)
{
stateChanged = false;
return;
}
if (_state == ControlState.Starting)
{
_state = ControlState.Active;
}
if (_state == ControlState.Ending)
{
_state = ControlState.Inactive;
}
}
示例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;
}
}