本文整理汇总了C#中Microsoft.Xna.Framework.Input.KeyboardState.IsShiftDown方法的典型用法代码示例。如果您正苦于以下问题:C# KeyboardState.IsShiftDown方法的具体用法?C# KeyboardState.IsShiftDown怎么用?C# KeyboardState.IsShiftDown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Xna.Framework.Input.KeyboardState
的用法示例。
在下文中一共展示了KeyboardState.IsShiftDown方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawLogic
//.........这里部分代码省略.........
// Delete normal tiles from start to end
if (mDrawMode.Has(EDrawMode.Fill) && mDrawMode.HasNot(EDrawMode.Animation)) {
SetCells(startPoint, endPoint, TileCell.Empty);
if (MenuSettingsOneTimeFill.Checked) {
MenuToolStripDrawFillButton.PerformClick();
}
// Delete single tile
} else if (mDrawMode.HasNot(EDrawMode.Animation)) {
SetCell(startPoint, TileCell.Empty, false);
// Delete a animation cell
} else if (mDrawMode.Has(EDrawMode.Animation)) {
mTileMap.AnimationLayer.SetCell(startPoint, null);
}
// Draw a normal tile
} else if (mDrawMode.Has(EDrawMode.Draw) && mDrawMode.HasNot(EDrawMode.Rotate | EDrawMode.NotTilesetMode | EDrawMode.Flipping)) {
// Nee a valid texture selection
if (mTextureRect.Width > 0 || mTextureRect.Height > 0) {
// Draw more than once?
if (mDrawMode.Has(EDrawMode.Fill)) {
// Draw from start to end
SetCellGroups(startPoint, endPoint);
if (MenuSettingsOneTimeFill.Checked) {
MenuToolStripDrawFillButton.PerformClick();
}
} else {
// Draw a single tile
SetCellGroup(startPoint, false);
}
}
// Draw a collision tile
} else if (mDrawMode.Has(EDrawMode.Collision)) {
// Get type of collision
var drawType = ECollisionType.NotMoveable;
if (mNewState.IsCtrlDown() || GetCapsLock) {
drawType = ECollisionType.Moveable;
} else if (mNewState.IsShiftDown() || GetScrollLock) {
drawType = ECollisionType.Water;
} else if (mNewState.IsKeyDown(XnaKeys.LeftAlt) /* || GetNumLock*/) {
drawType = ECollisionType.Underwater;
}
// Fill collisions from start to end?
if (mDrawMode.Has(EDrawMode.Fill)) {
var baseType = mTileMap.CollisionLayer.GetCell(startPoint.X, startPoint.Y);
for (var x = startPoint.X; x < endPoint.X; x++) {
for (var y = startPoint.Y; y < endPoint.Y; y++) {
if (MenuSettingsFillSameTexture.Checked && mTileMap.CollisionLayer.GetCell(x, y) != baseType) {
continue;
}
mTileMap.CollisionLayer.SetCell(x, y, drawType);
}
}
if (MenuSettingsOneTimeFill.Checked) {
MenuToolStripDrawFillButton.PerformClick();
}
} else {
// Just a single draw
mTileMap.CollisionLayer.SetCell(startPoint, drawType);
}
}
}
if (mCurrentLayer == -1) {
return;
}
if ((mMouseOnMapRightButton || mMouseOnMapLeftButton) && mDrawMode.Has(EDrawMode.Rotate) && mDrawMode.HasNot(EDrawMode.NotTilesetMode | EDrawMode.Flipping | EDrawMode.Collision)) {
var cell = mTileMap.Layers[mCurrentLayer].GetCell(startPoint.X, startPoint.Y);
if (cell.IsEqualTo(TileCell.Empty) == false && cell.TextureSource.TextureIndex != string.Empty && CanRotate(startPoint)) {
var rotation = (mMouseOnMapRightButton ? 1.5f : -1.5f);
if (mNewState.IsCtrlDown()) {
rotation /= 10f;
}
cell.Rotation += rotation;
if (cell.Rotation >= 6f || cell.Rotation <= -6f) {
cell.Rotation = 0f;
}
mTileMap.Layers[mCurrentLayer].SetCell(startPoint, cell);
Debug.WriteLine("Rotation: " + cell.Rotation);
}
} else if (mMouseOnMapLeftButton && mDrawMode.Has(EDrawMode.Autotile) && mDrawMode.HasNot(EDrawMode.Rotate | EDrawMode.Erase | EDrawMode.Collision)) {
if (mDrawMode.Has(EDrawMode.Fill)) {
for (var x = startPoint.X; x < endPoint.X; x++) {
for (var y = startPoint.Y; y < endPoint.Y; y++) {
UpdateAutoTiles(new Point2D(x, y), true);
}
}
if (MenuSettingsOneTimeFill.Checked) {
MenuToolStripDrawFillButton.PerformClick();
}
} else {
UpdateAutoTiles(startPoint, true);
}
} else if (mMouseOnMapLeftButton && mDrawMode.Has(EDrawMode.Animation) && mDrawMode.HasNot(EDrawMode.Rotate | EDrawMode.Erase | EDrawMode.Collision)) {
mTileMap.AnimationLayer.SetCell(startPoint, mPreviewAnimation);
}
}