本文整理汇总了C#中Microsoft.Xna.Framework.GameTimerEventArgs.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# GameTimerEventArgs.ToString方法的具体用法?C# GameTimerEventArgs.ToString怎么用?C# GameTimerEventArgs.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Xna.Framework.GameTimerEventArgs
的用法示例。
在下文中一共展示了GameTimerEventArgs.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnDraw
/// <summary>
/// Allows the page to draw itself.
/// </summary>
private void OnDraw(object sender, GameTimerEventArgs e)
{
// Crop the XNA viewport to avoid drawing under the AppBar
SharedGraphicsDeviceManager.Current.GraphicsDevice.Viewport = new Viewport(0, 0, getVisibleWidth(), getVisibleHeight());
try
{
SharedGraphicsDeviceManager.Current.GraphicsDevice.Clear(Color.Black);
//Rendering Silverlight content into the UIElementRenderer object and the rendering its texture using the SpriteBatch object
elementRenderer.Render();
}
catch (Exception)
{ }
if (VertexActiveIndex > 3)
{
lock (this)
{
try
{
int ActiveIndex = whichPolygonArrayActive;
// Draw textured box
SharedGraphicsDeviceManager.Current.GraphicsDevice.RasterizerState = RasterizerState.CullNone; // vertex order doesn't matter
//SharedGraphicsDeviceManager.Current.GraphicsDevice.BlendState = BlendState.NonPremultiplied; // use alpha blending
SharedGraphicsDeviceManager.Current.GraphicsDevice.DepthStencilState = DepthStencilState.None; // don't bother with the depth/stencil buffer
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Apply();
SharedGraphicsDeviceManager.Current.GraphicsDevice.DrawUserPrimitives<VertexPositionColor>(PrimitiveType.TriangleList, filledPathPolygons[ActiveIndex], 0, VertexActiveIndex / 3);
}
try
{
spriteBatch.Begin();
}
catch (InvalidOperationException)
{
if (exc_count2 < 10)
{
exc_count2++;
Logger.log(e.ToString());
}
spriteBatch.End();
spriteBatch.Begin();
}
for (int i = 0; i < bitmapActiveIndex; i++)
{
Texture2D bitmap = bitmaps[ActiveIndex][i];
string[] xandy = ((string)(bitmap.Tag)).Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
int x = int.Parse(xandy[0]);
int y = int.Parse(xandy[1]);
spriteBatch.Draw(bitmap, new Microsoft.Xna.Framework.Rectangle(x, y, bitmap.Width, bitmap.Height), Color.Azure);
}
for (int i = 0; i < textStringActiveIndex; i++)
{
TextString textString = textStrings[ActiveIndex][i];
// Find the center of the string
Vector2 FontOrigin = new Vector2(0, textString.size + 5);
int x = textString.x;
int y = textString.y;
// Draw the string
try
{
spriteBatch.DrawString(Fonts[textString.size], textString.text, new Vector2(x, y), textString.color, MathHelper.ToRadians(textString.angle), FontOrigin,
1.0f, SpriteEffects.None, 0);
}
catch (ArgumentException)
{
// Sometimes the C code sends illegal chars - just ignore them
}
}
spriteBatch.End();
}
catch (Exception)
{
if (exc_count < 10)
{
exc_count++;
Logger.log(e.ToString());
}
}
}
}
try
{
// Using the texture from the UIElementRenderer, draw the SL content to the screen
//.........这里部分代码省略.........