private void textButton_Click(object sender, EventArgs e) { Text textPage = new Text(); this.Hide(); textPage.Show(); }
public void ShowObtain(Sprite itemSprite, string content, Vector2 spriteSize = default, string notice = "") { this.itemSprite = itemSprite; itemImage.sprite = this.itemSprite; contentText.text = content; if (spriteSize != Vector2.zero) { itemImage.rectTransform.sizeDelta = spriteSize; } if (notice != "") { noticeText.text = notice; noticeText.Show(); } else { noticeText.Hide(); } Open(); }
public void Update(GameTime gameTime, Rectangle playerRect) { Text intersecting = GetIntersecting(playerRect); if (intersecting == null || (_activeText != null && !_activeText.Intersects(playerRect))) foreach (var text in _texts.Where(t => t.Active)) text.Disable(); else foreach (var text in _texts.Where(t => t.Active && !t.Intersects(playerRect))) text.Disable(); intersecting = null; foreach (var text in GetAllIntersecting(playerRect)) { // We want to get the first intersecting text object that the player has not already been inside if (!text.Active) { text.Enable(); intersecting = text; } } var active = GetActive(); if (intersecting != null) { _activeText = intersecting; if (active == null || !active.EqualText(intersecting)) { _activeText.Hide(); _activeText.FadeIn(); } else { _activeText.Show(); } } active = GetActive(); if (active != null) active.Update(gameTime); }
public void SetNotice(string content) { noticeText.text = content; noticeText.Show(); }