本文整理汇总了C#中DisplayOrientation类的典型用法代码示例。如果您正苦于以下问题:C# DisplayOrientation类的具体用法?C# DisplayOrientation怎么用?C# DisplayOrientation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DisplayOrientation类属于命名空间,在下文中一共展示了DisplayOrientation类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: UpdateScreen
protected override void UpdateScreen(GameTime gameTime, DisplayOrientation displayOrientation)
{
if (input.CheckMousePress(ScreenRectangle))
{
changeScreenDelegate(ScreenState.Title);
}
}
开发者ID:chillerman91,项目名称:GameAiChrisDaniel,代码行数:7,代码来源:Gamewin.cs
示例2: DrawScreen
protected override void DrawScreen(SpriteBatch batch, DisplayOrientation screenOrientation)
{
Globals.map.Draw(batch);
Globals.Mobs.Draw(batch);
player.Draw(batch);
HUDPlayerInfo.Draw(batch);
}
开发者ID:chillerman91,项目名称:GameAiChrisDaniel,代码行数:7,代码来源:Gameplay.cs
示例3: DrawScreen
protected override void DrawScreen(SpriteBatch batch, DisplayOrientation displayOrientation)
{
background.Draw(batch);
batch.Draw(optionsText, new Rectangle(0, 0, ScreenWidth, ScreenHeight), Color.White);
fullscreenButton.Draw(batch);
backButton.Draw(batch);
}
开发者ID:chillerman91,项目名称:GameAiChrisDaniel,代码行数:7,代码来源:Options.cs
示例4: UpdateScreen
protected override void UpdateScreen(GameTime gameTime, DisplayOrientation displayOrientation)
{
if (input.CheckMousePress(gameButton))
{
changeScreenDelegate(ScreenState.Gameplay);
}
}
开发者ID:chillerman91,项目名称:GameAiChrisDaniel,代码行数:7,代码来源:Title.cs
示例5: GetOrientation
private Orientation GetOrientation(DisplayOrientation xnaOrientation)
{
Orientation = xnaOrientation == DisplayOrientation.LandscapeLeft ||
xnaOrientation == DisplayOrientation.LandscapeRight
? Orientation.Landscape : Orientation.Portrait;
return Orientation;
}
开发者ID:caihuanqing0617,项目名称:DeltaEngine.Xna,代码行数:7,代码来源:XnaWindow.cs
示例6: GraphicsDeviceManager
public GraphicsDeviceManager(Game game)
{
if (game == null)
{
throw new ArgumentNullException("The game cannot be null!");
}
this.game = game;
supportedOrientations = DisplayOrientation.Default;
PreferredBackBufferHeight = DefaultBackBufferHeight;
PreferredBackBufferWidth = DefaultBackBufferWidth;
PreferredBackBufferFormat = SurfaceFormat.Color;
PreferredDepthStencilFormat = DepthFormat.Depth24;
SynchronizeWithVerticalRetrace = true;
if (game.Services.GetService(typeof(IGraphicsDeviceManager)) != null)
{
throw new ArgumentException("Graphics Device Manager Already Present");
}
game.Services.AddService(typeof(IGraphicsDeviceManager), this);
game.Services.AddService(typeof(IGraphicsDeviceService), this);
}
开发者ID:khbecker,项目名称:FNA,代码行数:27,代码来源:GraphicsDeviceManager.cs
示例7: DrawScreen
protected override void DrawScreen(SpriteBatch spriteBatch, DisplayOrientation screenOrientation)
{
background.Draw(spriteBatch);
road.Draw(spriteBatch);
car.Draw(spriteBatch);
hazards.Draw(spriteBatch);
}
开发者ID:Vintharas,项目名称:WP7projects,代码行数:7,代码来源:MainGame.cs
示例8: DrawScreen
protected override void DrawScreen(SpriteBatch spriteBatch, DisplayOrientation screenOrientation)
{
background.Draw(spriteBatch);
titleText.Draw(spriteBatch);
startButton.Draw(spriteBatch);
exitButton.Draw(spriteBatch);
}
开发者ID:Vintharas,项目名称:WP7projects,代码行数:7,代码来源:Title.cs
示例9: ScreenConfig
public ScreenConfig()
{
// set defaults.
this.Width = 0; // make default resolution 0x0, so that it'll be only set if a platform requires so and sets the values - otherwise the system default will be used.
this.Height = 0;
this.IsFullScreen = false;
this.SupportedOrientations = DisplayOrientation.Default;
}
开发者ID:Cyberbanan,项目名称:voxeliq,代码行数:8,代码来源:ScreenConfig.cs
示例10: DrawScreen
protected override void DrawScreen(SpriteBatch batch, DisplayOrientation displayOrientation)
{
background.Draw(batch);
batch.Draw(titleText, new Rectangle(0, 0, ScreenWidth, ScreenHeight), Color.White);
gameButton.Draw(batch);
optionsButton.Draw(batch);
exitButton.Draw(batch);
}
开发者ID:chillerman91,项目名称:GameAiChrisDaniel,代码行数:8,代码来源:Title.cs
示例11: UpdateScreen
protected override void UpdateScreen(GameTime gameTime, DisplayOrientation screenOrientation)
{
road.Update(gameTime);
car.Update(gameTime);
hazards.Update(gameTime, car, HandleCarCollision);
if (previousHazardCount != hazards.HazardCount)
{
soundEffects.PlaySound("SoundEffects/HazardPass");
previousHazardCount = hazards.HazardCount;
}
}
开发者ID:Vintharas,项目名称:WP7projects,代码行数:11,代码来源:MainGame.cs
示例12: UpdateScreen
protected override void UpdateScreen(GameTime gameTime, DisplayOrientation displayOrientation)
{
if(input.CheckMousePress(fullscreenButton))
{
graphics.ToggleFullScreen();
}
if(input.CheckMousePress(backButton))
{
changeScreenDelegate(ScreenState.Title);
}
}
开发者ID:chillerman91,项目名称:GameAiChrisDaniel,代码行数:12,代码来源:Options.cs
示例13: UpdateScreen
protected override void UpdateScreen(GameTime gameTime, DisplayOrientation screenOrientation)
{
if (input.IsPressed(ActionStart))
{
soundEffects.PlaySound("SoundEffects/Select");
changeScreenDelegate(ScreenState.MainGame);
}
else if (input.IsPressed(ActionExit))
{
soundEffects.PlaySound("SoundEffects/Select");
changeScreenDelegate(ScreenState.Exit);
}
}
开发者ID:Vintharas,项目名称:WP7projects,代码行数:13,代码来源:Title.cs
示例14: GetReading
public static AccelerometerReading GetReading(DisplayOrientation orientation)
{
if (orientation == DisplayOrientation.Portrait)
{
return new AccelerometerReading(state,timeStamp);
}
var landLeft = new Vector3(-state.Y, state.X, state.Z);
if (orientation == DisplayOrientation.LandscapeLeft || orientation == DisplayOrientation.Default)
{
return new AccelerometerReading(landLeft, timeStamp);
}
return new AccelerometerReading(landLeft,timeStamp );
}
开发者ID:dreasgrech,项目名称:FPE3Sandbox,代码行数:13,代码来源:AccelerometerSensor.cs
示例15: Monitor
public Monitor(double left, double top, double width, double height, DisplayOrientation orientation)
: base("Monitor", new Size(width, height))
{
Top = top;
Left = left;
Width = width;
Height = height;
_orientation = orientation;
if (Top == 0 && Left == 0)
{
_fillBackground = false;
}
}
开发者ID:Heliflyer,项目名称:helios,代码行数:13,代码来源:Monitor.cs
示例16: UpdateWP7InputState
public void UpdateWP7InputState(GameTime gameTime, DisplayOrientation currentOrientation)
{
// DAK - Disabled this code because it was consuming Gestures before our app could process them.
//mCurrentOrientation = currentOrientation;
//#region Gesture support
//mHasTap = false;
//mHasTapTwo = false;
//mHDelta = 0.0f;
//mVDelta = 0.0f;
//if (TouchPanel.IsGestureAvailable) {
// GestureSample g = TouchPanel.ReadGesture();
// switch (g.GestureType)
// {
// case GestureType.Tap:
// mHasTap = true;
// break;
// case GestureType.Pinch:
// if (!mPinchHasBegin)
// {
// mHasTapTwo = true;
// mPinchHasBegin = true;
// }
// break;
// case GestureType.PinchComplete:
// mPinchHasBegin = false;
// break;
// case GestureType.FreeDrag:
// float x= (g.Delta.X) * kDRAG_UNIT;
// x = MathHelper.Clamp(x, -1f, 1f);
// float y= -(g.Delta.Y) * kDRAG_UNIT;
// y = MathHelper.Clamp(y, -1f, 1f);
// mHDelta = x;
// mVDelta = y;
// break;
// }
//}
//#endregion
}
开发者ID:AntMartz,项目名称:fat-cats-final,代码行数:45,代码来源:InputSupport_WP7.cs
示例17: Draw
public void Draw(GameTime gameTime, SpriteBatch spriteBatch, DisplayOrientation orientation)
{
switch (orientation)
{
case DisplayOrientation.LandscapeLeft:
Draw_Content(spriteBatch, _landscape);
break;
case DisplayOrientation.LandscapeRight:
Draw_Content(spriteBatch, _landscape);
break;
case DisplayOrientation.Portrait:
Draw_Content(spriteBatch, _portrait);
break;
case DisplayOrientation.Default:
Draw_Content(spriteBatch, _portrait);
break;
}
}
开发者ID:picque-g,项目名称:Electric-Potatoe-TD,代码行数:18,代码来源:Help.cs
示例18: ApplyChanges
public void ApplyChanges()
{
ThrowIfNotService();
// Store software settings
appliedSupportedOrientations = SupportedOrientations;
if(appliedSupportedOrientations == DisplayOrientation.Default)
{
if(PreferredBackBufferHeight > PreferredBackBufferWidth)
appliedSupportedOrientations = DisplayOrientation.Portrait;
else
appliedSupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;
}
Console.WriteLine("Setting supported orientations = " + appliedSupportedOrientations);
// Not supporting this for the time being...
// UIApplication.SharedApplication.StatusBarHidden = IsFullScreen;
}
开发者ID:jlyonsmith,项目名称:ExEnCopy,代码行数:19,代码来源:GraphicsDeviceManager.cs
示例19: GraphicsDeviceManager
public GraphicsDeviceManager(Game game)
{
if (game == null) {
throw new ArgumentNullException ("Game Cannot Be Null");
}
_game = game;
_supportedOrientations = DisplayOrientation.Default;
_preferredBackBufferHeight = PresentationParameters._defaultBackBufferHeight;
_preferredBackBufferWidth = PresentationParameters._defaultBackBufferWidth;
if (game.Services.GetService (typeof(IGraphicsDeviceManager)) != null) {
throw new ArgumentException ("Graphics Device Manager Already Present");
}
game.Services.AddService (typeof(IGraphicsDeviceManager), this);
game.Services.AddService (typeof(IGraphicsDeviceService), this);
}
开发者ID:JoelCarter,项目名称:MonoGame,代码行数:19,代码来源:GraphicsDeviceManager.cs
示例20: ApplyChanges
public void ApplyChanges()
{
ThrowIfNotService();
// Store software settings
appliedSupportedOrientations = SupportedOrientations;
if(appliedSupportedOrientations == DisplayOrientation.Default)
{
if(PreferredBackBufferHeight > PreferredBackBufferWidth)
appliedSupportedOrientations = DisplayOrientation.Portrait;
else
appliedSupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;
}
// Set Android requested orientations
bool portrait = (appliedSupportedOrientations & DisplayOrientation.Portrait) != 0;
bool landscapeLeft = (appliedSupportedOrientations & DisplayOrientation.LandscapeLeft) != 0;
bool landscapeRight = (appliedSupportedOrientations & DisplayOrientation.LandscapeRight) != 0;
// BUG: Android makes it difficult to support both landscape orientations...
// so for the time being, ExEn for Android doesn't either.
if(landscapeLeft != landscapeRight)
ExEnLog.WriteLine("WARNING: ExEn for Android cannot handle mismatched landscape modes");
bool landscape = landscapeLeft || landscapeRight;
if(portrait == landscape) // both (or neither, which shouldn't happen)
{
//activity.SetRequestedOrientation(Android.Content.PM.ScreenOrientation.Sensor);
}
else if(landscape)
{
// NOTE: Would prefer to use sensorLandscape, but that is only introduced in API level 9
// TODO: If adding support for different API versions, add a conditional that uses
// sensorLandscape on API level 9+
//activity.SetRequestedOrientation(Android.Content.PM.ScreenOrientation.Landscape);
}
else // portrait
{
// As above, would prefer to use sensorPortrait, but this requires API level 9
// I'm fairly sure that a phone-style device will treat sensorPortrait as portrait
// (no upside-down-portrait), and a pad will support it fully. This matches the
// difference between iPhone and iPad.
//activity.SetRequestedOrientation(Android.Content.PM.ScreenOrientation.Portrait);
}
}
开发者ID:eickegao,项目名称:tiny2d,代码行数:43,代码来源:GraphicsDeviceManager.cs
注:本文中的DisplayOrientation类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论