/// <summary> /// Render the help and statistics text. This function uses the Font object for /// efficient text rendering. /// </summary> private void RenderText() { TextHelper txtHelper = new TextHelper(statsFont, textSprite, 15); // Output statistics txtHelper.Begin(); txtHelper.SetInsertionPoint(5, 5); txtHelper.SetForegroundColor(System.Drawing.Color.Yellow); txtHelper.DrawTextLine(sampleFramework.FrameStats); txtHelper.DrawTextLine(sampleFramework.DeviceStats); txtHelper.SetForegroundColor(System.Drawing.Color.White); txtHelper.DrawTextLine("Press ESC to quit."); txtHelper.End(); }
/// <summary> /// Render the help and statistics text. This function uses the Font object for /// efficient text rendering. /// </summary> private void RenderText() { TextHelper txtHelper = new TextHelper(statsFont, textSprite, 15); // Output statistics txtHelper.Begin(); txtHelper.SetInsertionPoint(5, 5); txtHelper.SetForegroundColor(System.Drawing.Color.Yellow); txtHelper.DrawTextLine(sampleFramework.FrameStats); txtHelper.DrawTextLine(sampleFramework.DeviceStats); txtHelper.SetForegroundColor(System.Drawing.Color.White); if (isShowingOptimized) { txtHelper.DrawTextLine(OptimizedText, currentMeshIndex + 1, meshes.Length, meshes[currentMeshIndex].MinVertices, meshes[currentMeshIndex].MaxVertices, meshes[0].MinVertices, meshes[meshes.Length - 1].MaxVertices, (meshes[currentMeshIndex] as BaseMesh).NumberVertices); } else { txtHelper.DrawTextLine(UnoptimizedText, fullMesh.MinFaces, fullMesh.MaxFaces, (fullMesh as BaseMesh).NumberVertices); } // Draw help if (isHelpShowing) { txtHelper.SetInsertionPoint(10, sampleFramework.BackBufferSurfaceDescription.Height - 15 * 7); txtHelper.SetForegroundColor(System.Drawing.Color.DarkOrange); txtHelper.DrawTextLine("Controls (F1 to hide):"); txtHelper.SetInsertionPoint(40, sampleFramework.BackBufferSurfaceDescription.Height - 15 * 6); txtHelper.DrawTextLine("Rotate mesh: Left click drag"); txtHelper.DrawTextLine("Zoom: mouse wheel"); txtHelper.DrawTextLine("Quit: Esc"); txtHelper.DrawTextLine("Hide help: F1"); } else { txtHelper.SetInsertionPoint(10, sampleFramework.BackBufferSurfaceDescription.Height - 15 * 4); txtHelper.SetForegroundColor(System.Drawing.Color.White); txtHelper.DrawTextLine("Press F1 for help"); } txtHelper.End(); }
private void RenderText() { TextHelper txtHelper = new TextHelper(statsFont, textSprite, 15); txtHelper.Begin(); txtHelper.SetInsertionPoint(5, 5); // Output statistics txtHelper.SetForegroundColor(System.Drawing.Color.Yellow); txtHelper.DrawTextLine("Stats---------------"); frameCount++; if (frameCount == 100) { frameRate = 100 * 1000.0f / (Environment.TickCount - lastFrameTick); lastFrameTick = Environment.TickCount; frameCount = 0; } txtHelper.DrawTextLine("Avg Framerate: " + frameRate); txtHelper.DrawTextLine("Wii IR dots:" + remote.WiimoteState.IRState.Found1 + " " + remote.WiimoteState.IRState.Found2 + " " + remote.WiimoteState.IRState.Found3 + " " + remote.WiimoteState.IRState.Found4); txtHelper.DrawTextLine("Last Key Pressed: " + lastKey); txtHelper.DrawTextLine(""); txtHelper.DrawTextLine("Controls -----"); txtHelper.DrawTextLine("esc - Quit"); txtHelper.DrawTextLine(""); txtHelper.DrawTextLine("Show--------"); txtHelper.DrawTextLine("M - Mouse Cursor"); txtHelper.DrawTextLine("G - Grid"); txtHelper.DrawTextLine("H - Help Text"); txtHelper.DrawTextLine(""); txtHelper.End(); }
/// <summary> /// Render the help and statistics text. This function uses the Font object for /// efficient text rendering. /// </summary> private void RenderText(double appTime) { TextHelper txtHelper = new TextHelper(statsFont, textSprite, 15); // Output statistics txtHelper.Begin(); txtHelper.SetInsertionPoint(2, 0); txtHelper.SetForegroundColor(unchecked ((int)0xffffff00)); txtHelper.DrawTextLine(sampleFramework.FrameStats); txtHelper.DrawTextLine(sampleFramework.DeviceStats); txtHelper.SetForegroundColor(unchecked ((int)0xffffffff)); txtHelper.DrawTextLine("appTime: {0} sin(appTime): {1}", appTime.ToString("f2", System.Globalization.CultureInfo.CurrentUICulture), Math.Sin(appTime).ToString("f4", System.Globalization.CultureInfo.CurrentUICulture)); // Draw help if (isHelpShowing) { txtHelper.SetInsertionPoint(10, sampleFramework.BackBufferSurfaceDescription.Height - 15 * 6); txtHelper.SetForegroundColor(System.Drawing.Color.DarkOrange); txtHelper.DrawTextLine("Controls (F1 to hide):"); txtHelper.SetInsertionPoint(20, sampleFramework.BackBufferSurfaceDescription.Height - 15 * 5); txtHelper.DrawTextLine("Rotate model: Left mouse button"); txtHelper.DrawTextLine("Rotate light: Right mouse button"); txtHelper.DrawTextLine("Rotate camera: Middle mouse button"); txtHelper.DrawTextLine("Zoom camera: Mouse wheel scroll"); txtHelper.SetInsertionPoint(250, sampleFramework.BackBufferSurfaceDescription.Height - 15 * 5); txtHelper.DrawTextLine("Hide help: F1"); txtHelper.DrawTextLine("Quit: Esc"); } else { txtHelper.SetForegroundColor(unchecked ((int)0xffffffff)); txtHelper.DrawTextLine("Press F1 for help"); } txtHelper.End(); }
/// <summary> /// Render the help and statistics text. This function uses the Font object for /// efficient text rendering. /// </summary> private void RenderText() { TextHelper txtHelper = new TextHelper(statsFont, textSprite, 15); // Output statistics txtHelper.Begin(); txtHelper.SetInsertionPoint(5, 5); txtHelper.SetForegroundColor(System.Drawing.Color.Yellow); txtHelper.DrawTextLine(sampleFramework.FrameStats); txtHelper.DrawTextLine(sampleFramework.DeviceStats); // Draw help if (isHelpShowing) { txtHelper.SetInsertionPoint(10, sampleFramework.BackBufferSurfaceDescription.Height - 15 * 6); txtHelper.SetForegroundColor(System.Drawing.Color.DarkOrange); txtHelper.DrawTextLine("Controls (F1 to hide):"); txtHelper.SetInsertionPoint(40, sampleFramework.BackBufferSurfaceDescription.Height - 15 * 5); txtHelper.DrawTextLine("Rotate mesh: Left click drag"); txtHelper.DrawTextLine("Rotate camera: right click drag"); txtHelper.DrawTextLine("Zoom: mouse wheel"); txtHelper.DrawTextLine("Quit: Esc"); txtHelper.DrawTextLine("Hide help: F1"); } else { txtHelper.SetInsertionPoint(10, sampleFramework.BackBufferSurfaceDescription.Height - 15 * 2); txtHelper.SetForegroundColor(System.Drawing.Color.White); txtHelper.DrawTextLine("Press F1 for help"); } txtHelper.SetInsertionPoint(10, 65); txtHelper.SetForegroundColor(System.Drawing.Color.DarkOrange); txtHelper.DrawTextLine("Number Segments: {0}\n", numberSegments); txtHelper.DrawTextLine("Number Faces: {0}\n", (vidMemEnhancedMesh == null) ? 0 : vidMemEnhancedMesh.NumberFaces); txtHelper.DrawTextLine("Number Vertices: {0}\n", (vidMemEnhancedMesh == null) ? 0 : vidMemEnhancedMesh.NumberVertices); txtHelper.End(); }
/// <summary> /// Render the help and statistics text. This function uses the Font object for /// efficient text rendering. /// </summary> private void RenderText() { TextHelper txtHelper = new TextHelper(statsFont, textSprite, 15); // Output statistics txtHelper.Begin(); txtHelper.SetInsertionPoint(5, 5); txtHelper.SetForegroundColor(System.Drawing.Color.Yellow); txtHelper.DrawTextLine(sampleFramework.FrameStats); txtHelper.DrawTextLine(sampleFramework.DeviceStats); txtHelper.SetForegroundColor(System.Drawing.Color.White); if (tilesEnabled && (visibleTiles != null)) { txtHelper.DrawTextLine("Tiles Being Drawn: " + visibleTiles.Length); } // Draw help if (isHelpShowing) { txtHelper.SetInsertionPoint(10, sampleFramework.BackBufferSurfaceDescription.Height - 15 * 6); txtHelper.SetForegroundColor(System.Drawing.Color.DarkOrange); txtHelper.DrawTextLine("Controls (F1 to hide):"); txtHelper.SetInsertionPoint(40, sampleFramework.BackBufferSurfaceDescription.Height - 15 * 5); txtHelper.DrawTextLine("Move Tile View: Up Arrow, Down Arrow, Left Arrow, Right Arrow"); txtHelper.DrawTextLine("Zoom Tiles: Z, X"); txtHelper.DrawTextLine("Quit: Esc"); txtHelper.DrawTextLine("Hide help: F1"); } else { txtHelper.SetInsertionPoint(10, sampleFramework.BackBufferSurfaceDescription.Height - 15 * 2); txtHelper.SetForegroundColor(System.Drawing.Color.White); txtHelper.DrawTextLine("Press F1 for help"); } txtHelper.End(); }