void CreateCostLabel() { costLabel = new UIButton(null, Vector4.One, "$16000"); costLabel.Position = new Vector2(0, 0.85f); costLabel.Scale = new Vector2(0.15f, 0.15f); costLabel.SetTextColor(goldColor); this.controls.Add(costLabel); }
public PlayerScreen() : base() { this.scene = new Scene(); compass = new UICompass(); compass.Scale = new Vector2(0.35f, 0.05f); compass.Position = new Vector2(0, -0.85f); crosshair = new UIButton(ResourceManager.Inst.GetTexture("UI/Game/crossHair.dds"), Vector4.One, string.Empty); crosshair.Position = Vector2.Zero; crosshair.Scale = Vector2.One * 0.035f; scoreLabel = new UIButton(null, Vector4.One, "Score:"); scoreLabel.Position = new Vector2(0.7f, 0.85f); journalStatus = new UIButton(null, Vector4.One, "Journal Updated!"); journalStatus.Position = new Vector2(-0.7f, 0.85f); journalStatus.SetVisible(false); interactStatus = new UIButton(null, Vector4.One, "Examine Object"); interactStatus.Position = new Vector2(-0.7f, -0.85f); interactStatus.SetVisible(false); interactButton = new UIButton(ResourceManager.Inst.GetTexture("UI/Game/interact.dds"), Vector4.One, string.Empty); interactButton.Position = crosshair.Position; interactButton.Scale = crosshair.Scale * 1.15f; interactButton.SetVisible(false); list = new UIList(); list.ItemColor = new Vector4(0.15f, 0.15f, 0.15f, 1.0f); list.Position = new Vector2(0.5f, 0); list.Scale = new Vector2(0.25f, 0.5f); string[] testStrings = new string[] { "Hello", "A Carton of Cigarettes", "Oh boy", "I hope this works", "25 or 6 to 4", "Rawr", "Christ", "El Captain", "John Wayne", "Walter White", "Stanford Cow", "Dr. Evil", "Tom Hanks", "Lindsey Lohan", "Raptor Jesus", "Timothy Leary", "Bauldur", "Frank Lloyd Wright", "Pink Floyd", "The Beatles", "JoCo", "Is this twenty yet??", }; list.Items.AddRange(testStrings); list.SetColor(new Vector4(0.15f, 0.15f, 0.15f, 1.0f)); //this.controls.Add(list); this.controls.Add(crosshair); this.controls.Add(journalStatus); this.controls.Add(compass); this.controls.Add(interactStatus); this.controls.Add(interactButton); this.controls.Add(scoreLabel); }
void CreateHuntButton() { huntButton = new UIButton(null, goldColor, "Hunt!"); huntButton.Position = new Vector2(0.8f, -0.9f); huntButton.Scale = new Vector2(0.2f, 0.15f); this.controls.Add(huntButton); }
void CreateMiscButtons() { DinosaurDatablock firstDino = ResourceManager.Inst.GetDinosaurDatablock(dinosaurList.Items[0]); selectedDinosaurImage = new UIButton(firstDino.HuntImage, Vector4.One, string.Empty); selectedDinosaurImage.Position = new Vector2(-0.25f, 0.6f); selectedDinosaurImage.Scale = new Vector2(0.2f, 0.3f); this.controls.Add(selectedDinosaurImage); }
public PlayerScreen() : base() { inst = this; compass = new UICompass(); compass.Scale = new Vector2(0.35f, 0.05f); compass.Position = new Vector2(0, -0.85f); crosshair = new UIButton(ResourceManager.Inst.GetTexture("UI/Game/crossHair.dds"), Vector4.One, string.Empty); crosshair.Position = Vector2.Zero; crosshair.Scale = Vector2.One * 0.035f; journalStatus = new UIButton(null, Vector4.One, "Journal Updated!"); journalStatus.Position = new Vector2(0, 0.15f);// new Vector2(-0.7f, 0.85f); journalStatus.SetVisible(false); interactStatus = new UIButton(null, Vector4.One, "Examine Object"); interactStatus.Position = new Vector2(-0.7f, -0.85f); interactStatus.SetVisible(false); interactButton = new UIButton(ResourceManager.Inst.GetTexture("UI/Game/interact.dds"), Vector4.One, string.Empty); interactButton.Position = Vector2.Zero; interactButton.Scale = Vector2.One * 0.035f * 1.15f; interactButton.SetVisible(false); blackFade = new UIButton(null, Vector4.Zero, string.Empty); blackFade.Position = Vector2.Zero; blackFade.Scale = Vector2.One; blackFade.SetVisible(false); creditsLabel = new UIButton(null, Vector4.One, "Created by Matt Vitelli - Summer 2012"); creditsLabel.Position = Vector2.Zero; creditsLabel.Scale = Vector2.One; creditsLabel.SetVisible(false); list = new UIList(); list.ItemColor = new Vector4(0.15f, 0.15f, 0.15f, 1.0f); list.Position = new Vector2(0.5f, 0); list.Scale = new Vector2(0.25f, 0.5f); string[] testStrings = new string[] { "Hello", "A Carton of Cigarettes", "Oh boy", "I hope this works", "25 or 6 to 4", "Rawr", "Christ", "El Captain", "John Wayne", "Walter White", "Stanford Cow", "Dr. Evil", "Tom Hanks", "Lindsey Lohan", "Raptor Jesus", "Timothy Leary", "Bauldur", "Frank Lloyd Wright", "Pink Floyd", "The Beatles", "JoCo", "Is this twenty yet??", }; list.Items.AddRange(testStrings); list.SetColor(new Vector4(0.15f, 0.15f, 0.15f, 1.0f)); //this.controls.Add(list); healthBarTexture = (Texture2D)ResourceManager.Inst.GetTexture("UI/Game/healthBar.dds").GetTexture(); healthBarTexture2 = (Texture2D)ResourceManager.Inst.GetTexture("UI/Game/healthBar2.dds").GetTexture(); this.controls.Add(crosshair); this.controls.Add(journalStatus); this.controls.Add(compass); this.controls.Add(interactStatus); this.controls.Add(interactButton); this.controls.Add(blackFade); this.controls.Add(creditsLabel); this.scene = new Scene(); compass.AddCustomMarker(scene.FindEntity("Tent").Transformation, ResourceManager.Inst.GetTexture("UI/Game/Home.dds")); bgSound = new Sound2D("Crickets", true, false); bgSound.Paused = false; }
public void RecomputeLayout() { recomputeLayout = false; Vector2 minSize = this.position - this.scale; Vector2 maxSize = this.position + this.scale; Vector2 textSize = GFX.Inst.GetGUI().DefaultFont.MeasureString("A") / GFX.Inst.DisplayRes; displayCount = (int)(this.scale.Y * 2.0f / (textSize.Y * 3.0f)); displayItems = new UIButton[displayCount]; float deltaHeight = textSize.Y; for (int i = 0; ((i < displayCount) && ((scrollIndex + i) < Items.Count)); i++) { displayItems[i] = new UIButton(null, this.itemColor, Items[scrollIndex + i]); displayItems[i].Position = new Vector2(this.position.X, maxSize.Y - deltaHeight * 2 * (i+1)); displayItems[i].Scale = new Vector2(scale.X, deltaHeight); displayItems[i].SetTextColor(itemColor); } }