本文整理汇总了C#中Label.Draw方法的典型用法代码示例。如果您正苦于以下问题:C# Label.Draw方法的具体用法?C# Label.Draw怎么用?C# Label.Draw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Label
的用法示例。
在下文中一共展示了Label.Draw方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
/// <summary>
/// This is called when the game should draw itself.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Draw(GameTime gameTime)
{
Point[] joints;
lock (iKinect.KinectJoints)
{
joints = iKinect.KinectJoints.ToArray();
}
GraphicsDevice.Clear(iBackground);
GraphicsDevice.SetRenderTarget(colorRenderTarget);
spriteBatch.Begin();
spriteBatch.Draw(room, new Rectangle(0, 0, depthWidth, depthHeight), Color.White);
if (iKinect.KinectRGBVideo != null)
{
spriteBatch.Draw(iKinect.KinectRGBVideo, new Rectangle(0, 0, depthWidth, depthHeight), Color.White);
}
foreach (GermBase germ in germs)
{
germ.Draw(spriteBatch);
}
if (joints != null)
{
foreach (var J in joints)
{
spriteBatch.Draw(cloth, new Rectangle(J.X - 15, J.Y - 15, 30, 30), Color.White);
}
}
ScoreLabel lab2 = new ScoreLabel("Time Left: " + (int)(millisecondsLeftOfGame / 1000), "label", depthWidth - 300, 5, 0);
lab2.Load(Content);
lab2.Draw(spriteBatch);
if (millisecondsLeftOfGame <= 0)
{
var RestartLabel = new Label("Restart?", string.Empty, depthWidth - 100, 5, 0);
var FinalScoreLabel = new BigLabel(String.Format("Score: {0}", score), string.Empty, depthWidth / 3, depthHeight / 3, 0);
FinalScoreLabel.Load(Content);
FinalScoreLabel.Draw(spriteBatch);
RestartLabel.Load(Content);
RestartLabel.Draw(spriteBatch);
}
else
{
Label lab1 = new Label("Score: " + score, "label", 5, 5, 0);
lab1.Load(Content);
lab1.Draw(spriteBatch);
}
if (!spriteBatch.IsDisposed)
spriteBatch.End();
// Reset the device to the back buffer
GraphicsDevice.SetRenderTarget(null);
spriteBatch.Begin();
//entityManager.Draw(gameTime,spriteBatch);
//Drawing the video feed if we have one available.
spriteBatch.Draw(colorRenderTarget, new Rectangle(0, 0, screenWidth, screenHeight), Color.White);
//No longer displaying the connection status on the screen because we have the title bar now >=]
//Now we draw whatever scene is currently in the game!
//iSceneManager.DrawScene(gameTime, spriteBatch);
spriteBatch.End();
base.Draw(gameTime);
}