/// <summary> /// Default Constructor public TypingGameScene(Game game, SpriteFont font, Texture2D boxBackground, Texture2D theme, ContentManager Content) : base(game) { this.game = game; content = Content; //timeBetweenUpdates = (float)game.TargetElapsedTime.TotalSeconds; timeInterval = 6f; elapsedSeconds = TimeSpan.FromSeconds(0); whichParagraph = random.Next(paragraphLib.paragraphLib.Count); displayBox = new Textbox(topLeftX + 10, height - 300, width - 20, 260, paragraphLib.paragraphLib[whichParagraph].content); typingBox = new WritingBox(topLeftX + 10, height - 80, width - 20, 20); isMatching = true; this.boxBackground = boxBackground; Components.Add(new ImageComponent(game, theme, ImageComponent.DrawMode.Stretch)); this.font = font; // Get the current spritebatch spriteBatch = (SpriteBatch)Game.Services.GetService( typeof(SpriteBatch)); // Get the audio library audio = PoseidonGame.audio; Load(); }
private Box Enclosure_box(TexEnvironment environment, Box morphbox) { var texFont = environment.MathFont; var style = environment.Style; var axis = texFont.GetAxisHeight(style); var defaultLineThickness = texFont.GetDefaultLineThickness(style); var recbox = new RectangleBox(environment, morphbox.Height + morphbox.Depth, morphbox.TotalWidth, 0); var resultbox = new HorizontalBox(); resultbox.Add(morphbox); resultbox.Add(new StrutBox(-morphbox.Width, -morphbox.Height, 0, 0)); resultbox.Add(recbox); return(resultbox); }
protected override Box CreateBoxCore(TexEnvironment environment) { var texFont = environment.MathFont; var style = environment.Style; var defaultRuleThickness = texFont.GetDefaultLineThickness(style); var basebox = this.BaseAtom == null ? StrutBox.Empty : this.BaseAtom.CreateBox(environment); var rectbox = new RectangleBox(environment, basebox.TotalHeight + 4 * defaultRuleThickness, basebox.TotalWidth + 4 * defaultRuleThickness, 0) { Shift = basebox.Depth + 2 * defaultRuleThickness }; var resultbox = new HorizontalBox(); resultbox.Add(basebox); resultbox.Add(new StrutBox(-rectbox.TotalWidth + 2 * defaultRuleThickness, -rectbox.TotalHeight, 0, 0)); resultbox.Add(rectbox); return(resultbox); }
protected void Load() { // TODO: use this.Content to load your game content here trafficLightRed = content.Load<Texture2D>("Image/MinigameTextures/redlight"); trafficLightYellow = content.Load<Texture2D>("Image/MinigameTextures/yellowlight"); trafficLightGreen = content.Load<Texture2D>("Image/MinigameTextures/greenlight"); introductionTexture = content.Load<Texture2D>("Image/MinigameTextures/TypeGameIntro"); ((WritingBox)typingBox).loadContent(boxBackground, font); ((Textbox)displayBox).loadContent(boxBackground, font); startBox = new RectangleBox(trafficLightGreen.Width + 10, 10, 100, 200); //base.LoadContent(); }
/// <summary> /// Hide the start scene /// </summary> public override void Hide() { MediaPlayer.Stop(); if (paragraphLib.paragraphLib.Count > 5) // so that same para is not repeated. paragraphLib.paragraphLib.RemoveAt(whichParagraph); whichParagraph = random.Next(paragraphLib.paragraphLib.Count); displayBox = new Textbox(topLeftX + 10, height - 300, width - 20, 260, paragraphLib.paragraphLib[whichParagraph].content); typingBox = new WritingBox(topLeftX + 10, height - 80, width - 20, 20); ((WritingBox)typingBox).loadContent(boxBackground, font); ((Textbox)displayBox).loadContent(boxBackground, font); base.Hide(); }
public TreeData(string tagName, double probability, RectangleBox boundingBox) { TagName = tagName; Probability = probability; BoundingBox = boundingBox; }