/// <summary> /// create a console to show attributes etc /// </summary> /// <param name="width"></param> /// <param name="height"></param> public Console(int width,int height) { var sizeInPixels = new Vector2(width, height); this.consoleRect = new TextElementRect(sizeInPixels); this.consoleRect.Colour = Color.Gainsboro; //align the element rectangle to the bottom centre of the screen this.consoleRect.VerticalAlignment = VerticalAlignment.Bottom; this.consoleRect.HorizontalAlignment = HorizontalAlignment.Centre; }
public void Initalise(IGameStateManager stateManager) { this.stateManager = stateManager; //display an incredibly complex line of text this.menuText = new TextElementRect(new Vector2(400, 100)); this.menuText.Text.SetText("Press a button to start a new game!"); this.menuText.VerticalAlignment = VerticalAlignment.Centre; this.menuText.HorizontalAlignment = HorizontalAlignment.Centre; this.menuText.TextHorizontalAlignment = TextHorizontalAlignment.Centre; //set the text font (using global content) stateManager.Application.Content.Add(this); }
public void Initalise(IGameStateManager stateManager) { this.stateManager = stateManager; //put some text up... this.startText = new TextElementRect(new Vector2(400, 100)); this.startText.Text.SetText("Press the START button to begin"); this.startText.VerticalAlignment = VerticalAlignment.Centre; this.startText.HorizontalAlignment = HorizontalAlignment.Centre; this.startText.TextHorizontalAlignment = TextHorizontalAlignment.Centre; this.startText.Colour = Color.Red; //set the text font stateManager.Application.Content.Add(this); }
protected override void Initialise() { //create the draw target. drawToScreen = new DrawTargetScreen(this, new Camera3D()); //this element will display some help text helpDisplay = new TextElement(); helpDisplay.Position = new Vector2(100, -100); #if XBOX360 helpDisplay.Text.SetText("Use a chatpad to input text!"); #else helpDisplay.Text.SetText("Use the keyboard to input text!"); #endif //add it to the screen drawToScreen.Add(helpDisplay); //create the text this.textElement = new TextElementRect(new Vector2(400, 200)); this.textElement.Colour = Color.Yellow; //align the element to the bottom centre of the screen this.textElement.VerticalAlignment = VerticalAlignment.Bottom; this.textElement.HorizontalAlignment = HorizontalAlignment.Centre; //centre align the text this.textElement.TextHorizontalAlignment = TextHorizontalAlignment.Centre; //centre the text in the middle of the 400x200 area of the element this.textElement.TextVerticalAlignment = VerticalAlignment.Centre; //add it to the screen drawToScreen.Add(textElement); }
protected override void Initialise() { //create the draw target. drawToScreen = new DrawTargetScreen(new Camera3D()); //this element will display some help text helpDisplay = new TextElement(); helpDisplay.Position = new Vector2(100, -100); #if XBOX360 helpDisplay.Text.SetText("Use a chatpad to input text!"); #else helpDisplay.Text.SetText("Use the keyboard to input text!"); #endif //add it to the screen drawToScreen.Add(helpDisplay); //create the text this.textElement = new TextElementRect(new Vector2(400, 200)); this.textElement.Colour = Color.Yellow; //align the element to the bottom centre of the screen this.textElement.VerticalAlignment = VerticalAlignment.Bottom; this.textElement.HorizontalAlignment = HorizontalAlignment.Centre; //centre align the text this.textElement.TextHorizontalAlignment = TextHorizontalAlignment.Centre; //centre the text in the middle of the 400x200 area of the element this.textElement.TextVerticalAlignment = VerticalAlignment.Centre; //add it to the screen drawToScreen.Add(textElement); }
protected override void Initialise() { var tutorials = new Dictionary<string, Type>(); Program.FindTutorials(tutorials); Camera3D camera = new Camera3D(); drawToScreen = new DrawTargetScreen(camera); backgroundParticles = new ParticleSystem(this.UpdateManager); backgroundParticles.GlobalValues[0] = ArrowXOffset; backgroundParticles.GlobalValues[2] = (float)this.WindowWidth; backgroundParticles.GlobalValues[3] = (float)this.WindowHeight; particlesTarget = new DrawTargetTexture2D(camera, this.WindowWidth, this.WindowHeight, SurfaceFormat.Color, DepthFormat.None); particlesBlurred = new DrawTargetTexture2D(camera, this.WindowWidth / 2, this.WindowHeight / 2, SurfaceFormat.Color, DepthFormat.None); DrawTargetTexture2D inter0 = null, inter1 = null; quaterDownsample = new TextureDownsample(particlesTarget, particlesBlurred, ref inter0, ref inter1, particlesBlurred.Width, particlesBlurred.Height); inter0 = new DrawTargetTexture2D(camera, particlesBlurred.Width, particlesBlurred.Height, SurfaceFormat.Color, DepthFormat.None); blurFilter = new BlurFilter(BlurFilterFormat.SevenSampleBlur, 1, particlesBlurred, inter0); backroundDrawer = new VelocityBillboardParticles2DElement(backgroundParticles, false); particlesTarget.Add(backroundDrawer); //draw the resolved particles to the screen drawToScreen.Add(new TexturedElement(particlesTarget, new Vector2(1, 1), true)); //background block other elements are inserted into. invisible var selectionBlock = new Xen.Ex.Graphics2D.SolidColourElement(new Color(0, 0, 0, 0), new Vector2(ElementWidth, tutorials.Count * ElementSeparation)); selectionBlock.AlphaBlendState = AlphaBlendState.Alpha; selectionBlock.VerticalAlignment = VerticalAlignment.Top; this.menuBlock = selectionBlock; int y_pos = 0; foreach (var tutorial in tutorials) { var tut_item = new TutorialSelection(tutorial.Key, y_pos, this.Content, selectionBlock, this.UpdateManager, tutorial.Value); y_pos -= ElementSeparation; buttons.Add(tut_item); } drawToScreen.Add(selectionBlock); var bloom = new TexturedElement(particlesBlurred, new Vector2(1, 1), true); bloom.AlphaBlendState = AlphaBlendState.AdditiveSaturate; drawToScreen.Add(bloom); this.logo = new TexturedElement(new Vector2(282,100)); this.logo.VerticalAlignment = VerticalAlignment.Top; this.logo.HorizontalAlignment = HorizontalAlignment.Centre; this.logo.Position = new Vector2(0, -50); this.helperText = new TextElementRect(new Vector2(800,100),"Use the DPAD to select an item, press 'A' to run the example\nWhen running an example, press 'back' to return to this menu"); this.helperText.VerticalAlignment = VerticalAlignment.Bottom; this.helperText.HorizontalAlignment = HorizontalAlignment.Centre; this.helperText.TextHorizontalAlignment = TextHorizontalAlignment.Centre; this.helperText.TextVerticalAlignment = VerticalAlignment.Centre; this.helperText.Colour = Color.Gray; drawToScreen.Add(logo); drawToScreen.Add(helperText); }
public TutorialSelection(string text, int y_pos, IContentRegister content, ElementRect parent, UpdateManager update, Type value) { this.Value = value; this.YPos = XenMenuApp.ElementHeight * 0.5f - y_pos; background = new SolidColourElement[3]; for (int i = 0; i < background.Length; i++) { background[i] = new SolidColourElement(Color.Black, new Vector2(parent.Size.X, XenMenuApp.ElementHeight)); background[i].VerticalAlignment = VerticalAlignment.Top; background[i].HorizontalAlignment = HorizontalAlignment.Left; background[i].Position = new Vector2(0, (float)y_pos); parent.Add(background[i]); } //offset the elements a bit, to give a 3D effect. background[1].AlphaBlendState = AlphaBlendState.ModulateX2; background[2].AlphaBlendState = AlphaBlendState.ModulateX2; background[1].Size -= new Vector2(1, 1); background[1].Position += new Vector2(1, 0); background[2].Size -= new Vector2(1, 1); background[2].Position -= new Vector2(0, 1); this.text = new TextElementRect(new Vector2(parent.Size.X - XenMenuApp.ElementTextOffset, XenMenuApp.ElementHeight), text); this.text.VerticalAlignment = VerticalAlignment.Top; this.text.HorizontalAlignment = HorizontalAlignment.Left; this.text.Position = new Vector2(XenMenuApp.ElementTextOffset, (float)y_pos); parent.Add(this.text); content.Add(this); update.Add(this); }
public void Initalise(IGameStateManager stateManager) { this.stateManager = stateManager; //display an incredibly complex line of text this.menuText = new TextElementRect(new Vector2(400, 100)); this.menuText.Text.SetText("Press a button to start a new game!"); this.menuText.VerticalAlignment = VerticalAlignment.Centre; this.menuText.HorizontalAlignment = HorizontalAlignment.Centre; this.menuText.TextHorizontalAlignment = TextHorizontalAlignment.Centre; //set the text font (using global content) stateManager.Application.Content.Add(this); }
public void Initalise(IGameStateManager stateManager) { this.stateManager = stateManager; //put some text up... this.startText = new TextElementRect(new Vector2(400,100)); this.startText.Text.SetText("Press the START button to begin"); this.startText.VerticalAlignment = VerticalAlignment.Centre; this.startText.HorizontalAlignment = HorizontalAlignment.Centre; this.startText.TextHorizontalAlignment = TextHorizontalAlignment.Centre; this.startText.Colour = Color.Red; //set the text font stateManager.Application.Content.Add(this); }
/// <summary></summary> /// <param name="name"></param> /// <param name="width"></param> /// <param name="height"></param> /// <param name="samples"></param> /// <param name="fontHeight"></param> /// <param name="font"></param> /// <param name="minScale"></param> /// <param name="goodValue">The value that determines the transition from green to red on the graph</param> public Graph(string name, int width, int height, int samples, int fontHeight, float minScale, SpriteFont font, float goodValue) : base(new Vector2((float)width, (float)height), false) { if (width < fontHeight || height < fontHeight) throw new ArgumentException("size is too small for font size"); graph = new GraphDrawer(samples, Color.Red, new Vector2(), minScale, goodValue); float edge = 0.25f; graph.VerticalScaling = ElementScaling.FillToParentPlusSize; graph.HorizontalScaling = ElementScaling.FillToParentPlusSize; graph.Position = new Vector2((float)(fontHeight) *edge, (float)(fontHeight)); graph.Size = -graph.Position; title = new TextElementRect(Vector2.Zero, name,font); title.VerticalAlignment = VerticalAlignment.Top; title.HorizontalAlignment = HorizontalAlignment.Left; title.HorizontalScaling = ElementScaling.FillToParentPlusSize; title.VerticalScaling = ElementScaling.FillToParentPlusSize; title.TextHorizontalAlignment = TextHorizontalAlignment.Centre; title.TextVerticalAlignment = VerticalAlignment.Top; title.Size = new Vector2(0, 0); value = new TextElementRect(Vector2.Zero, "0",font); value.VerticalAlignment = VerticalAlignment.Bottom; value.HorizontalAlignment = HorizontalAlignment.Left; value.HorizontalScaling = ElementScaling.FillToParentPlusSize; value.VerticalScaling = ElementScaling.FillToParentPlusSize; value.TextHorizontalAlignment = TextHorizontalAlignment.Right; value.TextVerticalAlignment = VerticalAlignment.Bottom; value.Size = new Vector2(0, 0); value.Position = new Vector2(-10, 0); this.Add(title); this.Add(value); this.Add(graph); float x = fontHeight / ((float)width); float y = fontHeight / ((float)height); this.AlphaBlendState = AlphaBlendState.Alpha; VertexPositionColor[] verts = new VertexPositionColor[] { new VertexPositionColor(new Vector3(x*edge,y,0),Color.White), new VertexPositionColor(new Vector3(1-x*edge,y,0),Color.White), new VertexPositionColor(new Vector3(x*edge,y,0),Color.White), new VertexPositionColor(new Vector3(x*edge,1-y,0),Color.White), new VertexPositionColor(new Vector3(edge*x,y + 0.25f * (1-y*2),0),new Color(255,255,255,16)), new VertexPositionColor(new Vector3(1-x*edge,y + 0.25f * (1-y*2),0),new Color(255,255,255,16)), new VertexPositionColor(new Vector3(edge*x,y + 0.5f * (1-y*2),0),new Color(255,255,255,16)), new VertexPositionColor(new Vector3(1-x*edge,y + 0.5f * (1-y*2),0),new Color(255,255,255,16)), new VertexPositionColor(new Vector3(edge*x,y + 0.75f * (1-y*2),0),new Color(255,255,255,16)), new VertexPositionColor(new Vector3(1-x*edge,y + 0.75f * (1-y*2),0),new Color(255,255,255,16)), new VertexPositionColor(new Vector3(edge*x,y,0),new Color(255,255,255,16)), new VertexPositionColor(new Vector3(1-x*edge,y,0),new Color(255,255,255,16)), }; outline = new Vertices<VertexPositionColor>(verts); background = new Vertices<VertexPositionColor>(new VertexPositionColor[] { new VertexPositionColor(new Vector3(0,0,0),new Color(0,0,0,200)), new VertexPositionColor(new Vector3(0,1,0),new Color(0,0,0,200)), new VertexPositionColor(new Vector3(1,0,0),new Color(0,0,0,200)), new VertexPositionColor(new Vector3(1,1,0),new Color(0,0,0,200)), }); }
/// <summary></summary> /// <param name="name"></param> /// <param name="width"></param> /// <param name="height"></param> /// <param name="samples"></param> /// <param name="fontHeight"></param> /// <param name="font"></param> /// <param name="minScale"></param> /// <param name="goodValue">The value that determines the transition from green to red on the graph</param> public Graph(string name, int width, int height, int samples, int fontHeight, float minScale, SpriteFont font, float goodValue) : base(new Vector2((float)width, (float)height), false) { if (width < fontHeight || height < fontHeight) { throw new ArgumentException("size is too small for font size"); } graph = new GraphDrawer(samples, Color.Red, new Vector2(), minScale, goodValue); float edge = 0.25f; graph.VerticalScaling = ElementScaling.FillToParentPlusSize; graph.HorizontalScaling = ElementScaling.FillToParentPlusSize; graph.Position = new Vector2((float)(fontHeight) * edge, (float)(fontHeight)); graph.Size = -graph.Position; title = new TextElementRect(Vector2.Zero, name, font); title.VerticalAlignment = VerticalAlignment.Top; title.HorizontalAlignment = HorizontalAlignment.Left; title.HorizontalScaling = ElementScaling.FillToParentPlusSize; title.VerticalScaling = ElementScaling.FillToParentPlusSize; title.TextHorizontalAlignment = TextHorizontalAlignment.Centre; title.TextVerticalAlignment = VerticalAlignment.Top; title.Size = new Vector2(0, 0); value = new TextElementRect(Vector2.Zero, "0", font); value.VerticalAlignment = VerticalAlignment.Bottom; value.HorizontalAlignment = HorizontalAlignment.Left; value.HorizontalScaling = ElementScaling.FillToParentPlusSize; value.VerticalScaling = ElementScaling.FillToParentPlusSize; value.TextHorizontalAlignment = TextHorizontalAlignment.Right; value.TextVerticalAlignment = VerticalAlignment.Bottom; value.Size = new Vector2(0, 0); value.Position = new Vector2(-10, 0); this.Add(title); this.Add(value); this.Add(graph); float x = fontHeight / ((float)width); float y = fontHeight / ((float)height); this.AlphaBlendState = AlphaBlendState.Alpha; VertexPositionColor[] verts = new VertexPositionColor[] { new VertexPositionColor(new Vector3(x * edge, y, 0), Color.White), new VertexPositionColor(new Vector3(1 - x * edge, y, 0), Color.White), new VertexPositionColor(new Vector3(x * edge, y, 0), Color.White), new VertexPositionColor(new Vector3(x * edge, 1 - y, 0), Color.White), new VertexPositionColor(new Vector3(edge * x, y + 0.25f * (1 - y * 2), 0), new Color(255, 255, 255, 16)), new VertexPositionColor(new Vector3(1 - x * edge, y + 0.25f * (1 - y * 2), 0), new Color(255, 255, 255, 16)), new VertexPositionColor(new Vector3(edge * x, y + 0.5f * (1 - y * 2), 0), new Color(255, 255, 255, 16)), new VertexPositionColor(new Vector3(1 - x * edge, y + 0.5f * (1 - y * 2), 0), new Color(255, 255, 255, 16)), new VertexPositionColor(new Vector3(edge * x, y + 0.75f * (1 - y * 2), 0), new Color(255, 255, 255, 16)), new VertexPositionColor(new Vector3(1 - x * edge, y + 0.75f * (1 - y * 2), 0), new Color(255, 255, 255, 16)), new VertexPositionColor(new Vector3(edge * x, y, 0), new Color(255, 255, 255, 16)), new VertexPositionColor(new Vector3(1 - x * edge, y, 0), new Color(255, 255, 255, 16)), }; outline = new Vertices <VertexPositionColor>(verts); background = new Vertices <VertexPositionColor>(new VertexPositionColor[] { new VertexPositionColor(new Vector3(0, 0, 0), new Color(0, 0, 0, 200)), new VertexPositionColor(new Vector3(0, 1, 0), new Color(0, 0, 0, 200)), new VertexPositionColor(new Vector3(1, 0, 0), new Color(0, 0, 0, 200)), new VertexPositionColor(new Vector3(1, 1, 0), new Color(0, 0, 0, 200)), }); }
protected override void Initialise() { //DrawStatisticsDisplay requires that resource tracking is enabled Resource.EnableResourceTracking(); //Xen.Ex provides a very useful Camera3D called 'FirstPersonControlledCamera3D'. //This camera uses player input to act as a simple first-person style flythrough camera Xen.Ex.Camera.FirstPersonControlledCamera3D camera = null; //it uses player input, so the UpdateManager must be passed in camera = new Xen.Ex.Camera.FirstPersonControlledCamera3D(this.UpdateManager); //in this case, we want the z-axis to be the up/down axis (otherwise it's the Y-axis) camera.ZAxisUp = true; //also it's default is a bit too fast moving camera.MovementSensitivity *= 0.1f; camera.LookAt(new Vector3(1, 0, 0), new Vector3(), new Vector3(0, 0, 1)); this.camera = camera; //create the draw target. drawToScreen = new DrawTargetScreen(this, camera); //create a large number of actor instance from tutorial 10.. for (int n = 0; n <= 16; n++) { //create in a half circle float angle = (n / 16.0f) * MathHelper.Pi; Vector3 position = new Vector3((float)Math.Sin(angle), (float)Math.Cos(angle), 0); //not too close together position *= 10; drawToScreen.Add(new Tutorial_10.Actor(this.Content, position)); } //this element will display the camera position positionDisplay = new TextElement(); //TextElement (unlike other Elements) defaults to Top Left alignment //So, in order to bring it closer to the centre of the screen (due to potential overscan) //it's position needs to be set 'right' and 'down' from 'top left' //(this is just an example, see XNA docs for correct overscan compensation behaviour) positionDisplay.Position = new Vector2(40, -40); //offset from top left corner alignment //add it to the screen drawToScreen.Add(positionDisplay); Vector2 sizeInPixels = new Vector2(400, 200); //create the main block of yellow text this.yellowElement = new TextElementRect(sizeInPixels); this.yellowElement.Colour = Color.Yellow; //first line of text... this will have a flashing 2D element embedded string embeddedText = @"This is a text box with a large amount of custom text! It also includes an embedded 2D element: , which is a 16x16 SolidColourElement"; uint insertAtIndex = 96; // Hard coded to insert a 2D element at character index 96 which is about here: ^ //add a bunch of text... this.yellowElement.Text.AppendLine(embeddedText); this.yellowElement.Text.AppendLine(); this.yellowElement.Text.AppendLine(@"This class is:"); this.yellowElement.Text.AppendLine(this.GetType().FullName); this.yellowElement.Text.AppendLine(@"It is located in assembly:"); this.yellowElement.Text.AppendLine(this.GetType().Assembly.FullName); this.yellowElement.Text.AppendLine(); //add an embedded 2D element within the text //create it.. this.embeddedElement = new SolidColourElement(Color.Red, new Vector2(16, 16)); // quite small this.embeddedElement.AlphaBlendState = AlphaBlendState.Alpha; //add it. this.yellowElement.AddInline(this.embeddedElement, insertAtIndex); #if XBOX360 this.yellowElement.Text.AppendLine(@"Press and hold both thumbsticks to show the debug overlay"); #else this.yellowElement.Text.AppendLine(@"Press F12 to show the debug overlay"); #endif //align the element rectangle to the bottom centre of the screen this.yellowElement.VerticalAlignment = VerticalAlignment.Bottom; this.yellowElement.HorizontalAlignment = HorizontalAlignment.Centre; //centre align the text this.yellowElement.TextHorizontalAlignment = TextHorizontalAlignment.Centre; //centre the text in the middle of the 400x200 area of the element rectangle this.yellowElement.TextVerticalAlignment = VerticalAlignment.Centre; //add it to the screen drawToScreen.Add(yellowElement); //create the statistics display //this class will query the DrawState for the previous frames DrawStatistics structure. //this structure provides a large number of statistics for the drawn frame. //The DrawStatisticsDisplay displays some of the more important statistics. It will also //display thread activity on the xbox. //DrawStatistics are only available in DEBUG xen builds //They can be accessed at runtime with DrawState GetPreviousFrameStatistics() //at runtime, pressing 'F12' will toggle the overlay (or holding both thumbsticks on x360) this.statisticsOverlay = new Xen.Ex.Graphics2D.Statistics.DrawStatisticsDisplay(this.UpdateManager); //As of xen 1.5, by default the DrawStatisticsDisplay displays a significantly reduced number of graphs. //To display the full set of graphs (which generally takes up the entire screen), set the following //property to 'true': //this.statisticsOverlay.DisplayFullGraphList = true; //then add it to the screen drawToScreen.Add(statisticsOverlay); }
protected override void Initialise() { //Xen.Ex provides a very useful Camera3D called 'FirstPersonControlledCamera3D'. //This camera uses player input to act as a simple first-person style flythrough camera Xen.Camera.FirstPersonControlledCamera3D camera = null; //it uses player input, so the UpdateManager must be passed in camera = new Xen.Camera.FirstPersonControlledCamera3D(this.UpdateManager); //in this case, we want the z-axis to be the up/down axis (otherwise it's the Y-axis) camera.ZAxisUp = true; //also it's default is a bit too fast moving camera.MovementSensitivity *= 0.1f; camera.LookAt(new Vector3(1, 0, 0), new Vector3(), new Vector3(0, 0, 1)); this.camera = camera; //create the draw target. drawToScreen = new DrawTargetScreen(camera); //create a large number of actor instance from tutorial 10.. for (int n = 0; n <= 16; n++) { //create in a half circle float angle = (n / 16.0f) * MathHelper.Pi; var position = new Vector3((float)Math.Sin(angle), (float)Math.Cos(angle), 0); //not too close together position *= 10; drawToScreen.Add(new Tutorial_10.Actor(this.Content, position)); } //this element will display the camera position positionDisplay = new TextElement(); //TextElement (unlike other Elements) defaults to Top Left alignment //So, in order to bring it closer to the centre of the screen (due to potential overscan) //it's position needs to be set 'right' and 'down' from 'top left' //(this is just an example, see XNA docs for correct overscan compensation behaviour) positionDisplay.Position = new Vector2(40, -40); //offset from top left corner alignment //add it to the screen drawToScreen.Add(positionDisplay); var sizeInPixels = new Vector2(400, 200); //create the main block of yellow text this.yellowElement = new TextElementRect(sizeInPixels); this.yellowElement.Colour = Color.Yellow; //first line of text... this will have a flashing 2D element embedded string embeddedText = @"This is a text box with a large amount of custom text! It also includes an embedded 2D element: , which is a 16x16 SolidColourElement"; uint insertAtIndex = 96; // Hard coded to insert a 2D element at character index 96 which is about here: ^ //add a bunch of text... this.yellowElement.Text.AppendLine(embeddedText); this.yellowElement.Text.AppendLine(); this.yellowElement.Text.AppendLine(@"This class is:"); this.yellowElement.Text.AppendLine(this.GetType().FullName); this.yellowElement.Text.AppendLine(@"It is located in assembly:"); this.yellowElement.Text.AppendLine(this.GetType().Assembly.FullName); this.yellowElement.Text.AppendLine(); //add an embedded 2D element within the text //create it.. this.embeddedElement = new SolidColourElement(Color.Red, new Vector2(16, 16)); // quite small this.embeddedElement.AlphaBlendState = AlphaBlendState.Alpha; //add it. this.yellowElement.AddInline(this.embeddedElement, insertAtIndex); #if XBOX360 this.yellowElement.Text.AppendLine(@"Press and hold both thumbsticks to show the debug overlay"); #else this.yellowElement.Text.AppendLine(@"Press F12 to show the debug overlay"); #endif //align the element rectangle to the bottom centre of the screen this.yellowElement.VerticalAlignment = VerticalAlignment.Bottom; this.yellowElement.HorizontalAlignment = HorizontalAlignment.Centre; //centre align the text this.yellowElement.TextHorizontalAlignment = TextHorizontalAlignment.Centre; //centre the text in the middle of the 400x200 area of the element rectangle this.yellowElement.TextVerticalAlignment = VerticalAlignment.Centre; //add it to the screen drawToScreen.Add(yellowElement); //create the statistics display //this class will query the DrawState for the previous frames DrawStatistics structure. //this structure provides a large number of statistics for the drawn frame. //The DrawStatisticsDisplay displays some of the more important statistics. It will also //display thread activity on the xbox. //DrawStatistics are only available in DEBUG xen builds //They can be accessed at runtime with DrawState GetPreviousFrameStatistics() //at runtime, pressing 'F12' will toggle the overlay (or holding both thumbsticks on x360) this.statisticsOverlay = new Xen.Ex.Graphics2D.Statistics.DrawStatisticsDisplay(this.UpdateManager); //then add it to the screen drawToScreen.Add(statisticsOverlay); }