// Loading the content and setting up said content public void LoadContent(ContentManager Content, GraphicsDevice graphicsDevice) { backgroundManager.LoadContent(Content, graphicsDevice, @"Backgrounds\Clouds\Cloud-Blue-1", @"Backgrounds\Clouds\Cloud-Blue-2"); HeaderFont = Content.Load <SpriteFont>(@"Fonts\StartMenuHeaderFont"); HUDFont = Content.Load <SpriteFont>(@"Fonts\HUDFont"); HeaderPosition = new Vector2(Game1.ViewPortWidth / 2 - (HeaderFont.MeasureString("Levi Challenge").X / 2), Game1.ViewPortHeight / 20); MadeByPosition = new Vector2(10, Game1.ViewPortHeight - HUDFont.MeasureString("Made by Nathan Todd").Y); boxHeaderLine = new GuiBox(new Vector2(Game1.ViewPortWidth / 2 - (float)((HeaderFont.MeasureString("Levi Challenge").X * 1.3) / 2), Game1.ViewPortHeight / 6), (int)(HeaderFont.MeasureString("Levi Challenge").X * 1.3), 2, 0, Color.White * 0.4f, Color.White, graphicsDevice); btnNewGame = new GuiButton(new Vector2(Game1.ViewPortWidth / 2 - 168, Game1.ViewPortHeight / 4), 336, 69, 0, Color.Black * 0.3f, Color.YellowGreen * 0.3f, Color.White, Color.White * 0.6f, "New Game", @"Fonts\StartMenuButtonFont"); btnContinue = new GuiButton(new Vector2(Game1.ViewPortWidth / 2 - 168, Game1.ViewPortHeight / 4 + 69), 336, 69, 0, Color.Black * 0.15f, Color.YellowGreen * 0.15f, Color.White, Color.White * 0.6f, "Continue", @"Fonts\StartMenuButtonFont"); btnOptions = new GuiButton(new Vector2(Game1.ViewPortWidth / 2 - 168, Game1.ViewPortHeight / 4 + 138), 336, 69, 0, Color.Black * 0.3f, Color.YellowGreen * 0.3f, Color.White, Color.White * 0.6f, "Options", @"Fonts\StartMenuButtonFont"); btnExit = new GuiButton(new Vector2(Game1.ViewPortWidth / 2 - 168, Game1.ViewPortHeight / 4 + 207), 336, 69, 0, Color.Black * 0.15f, Color.YellowGreen * 0.15f, Color.White, Color.White * 0.6f, "Exit", @"Fonts\StartMenuButtonFont"); guiSystem.Add(boxHeaderLine); guiSystem.Add(btnNewGame); guiSystem.Add(btnContinue); guiSystem.Add(btnOptions); guiSystem.Add(btnExit); guiSystem.LoadContent(Content, graphicsDevice); guiSystem.ButtonIndexUpdate(0); }
// Use this for initialization void Start() { // displays a text in the inventory section mTextControllerGO = GameObject.Find("TextController"); mShowTextScript = mTextControllerGO.GetComponent <ShowText>(); mGuiBoxGO = GameObject.Find("TextController"); mGuiBoxScript = mGuiBoxGO.GetComponent <GuiBox> (); mTargetName = gameObject.transform.name; }
public void LoadContent(ContentManager content, GraphicsDevice graphicsDevice) { txtBoxWaves = new GuiTextBox(new Vector2(Game1.ViewPortWidth - 147, Game1.ViewPortHeight - 39), 137, 29, 1, Color.Black * 0.39f, new Color(98, 0, 0), "Waves: " + SpawnManager.WaveCount, @"Fonts\HUDFont"); boxLifeBars = new GuiBox(new Vector2(10, Game1.ViewPortHeight - 54), 162, 44, 1, Color.Black * 0.39f, new Color(98, 0, 0), graphicsDevice); lfbHealthBar = new GuiLifeBar(new Vector2(28, Game1.ViewPortHeight - 45), playerRef.myShip.Health, @"Sprites\GUI\Health-Bar"); lfbShieldBar = new GuiLifeBar(new Vector2(28, Game1.ViewPortHeight - 29), playerRef.myShip.Shield, @"Sprites\GUI\Shield-Bar"); guiSystem.Add(txtBoxScore); guiSystem.Add(txtBoxFlamoca); guiSystem.Add(txtBoxWaves); guiSystem.Add(boxLifeBars); guiSystem.Add(lfbHealthBar); guiSystem.Add(lfbShieldBar); guiSystem.LoadContent(content, graphicsDevice); }
void Start() // Use this for initialization // displays a text in the inventory section { mTextControllerGO = GameObject.Find("TextController"); mShowTextScript = mTextControllerGO.GetComponent <ShowText>(); mGuiBoxScript = mTextControllerGO.GetComponent <GuiBox> (); // displays a gui box which can be set visible or invisible mGuiBoxGO = GameObject.Find("TextController"); mGuiBoxScript = mGuiBoxGO.GetComponent <GuiBox> (); // displays a debug console text line in the left upper corner mGuiLabelGO = GameObject.Find("TextController"); mGuiLabelScript = mGuiLabelGO.GetComponent <GuiLabel> (); mObject0 = GameObject.Find("BierflascheVoll"); mObject0.SetActive(false); mObject1 = GameObject.Find("coins"); mObject1.SetActive(false); mObject2 = GameObject.Find("Ausweis"); mObject2.SetActive(false); mObject3 = GameObject.Find("Handschuhe"); mObject3.SetActive(false); print("AndroidCommunicationController class started"); // SendFullNameToUnity ("##TestFullName"); // code for java connection //AndroidJNIHelper.debug = true; //AndroidJavaClass jc = new AndroidJavaClass("com.works.forme"); //AndroidJavaObject jo = new AndroidJavaObject ("com.works.forme.BlankFragment"); //jo.CallStatic ("showAd"); }
private void InitOther() { fMyLabel1 = new GuiLabel() { Name = "My Label 1", BackgroundColor = Color.LightPink, Text = "XXX", Margin = new GuiThickness(0), }; fMyLabel2 = new GuiLabel() { Name = "My Label 2", BackgroundColor = Color.LightPink, Text = "XXX", Margin = new GuiThickness(0), }; fMyBox1 = new GuiBox() { Name = "My Box 1", Width = 20, Height = 20, Margin = new GuiThickness(3), BackgroundColor = Color.White }; fMyBox2 = new GuiBox() { Name = "My Box 2", Width = 20, Height = 20, Margin = new GuiThickness(3), BackgroundColor = Color.White }; fMyBoxes = new List <GuiCanvasChild>(); for (int i = 0; i < 50; i++) { fMyBoxes.Add(new GuiCanvasChild() { X = 0, Y = 0, Control = new GuiBox() { Width = 10, Height = 10, BackgroundColor = Color.FloralWhite } }); } }
// Use this for initialization void Start() { print("Story.cs start method"); mTextControllerGO = GameObject.Find("TextController"); mBeerFullGO = GameObject.Find("BierflascheVoll"); mBeerEmptyGO = GameObject.Find("BierflascheLeer"); mBeerFullGO.SetActive(false); mBeerFullGO.GetComponent <SpriteRenderer> ().enabled = false; mBeerEmptyGO.SetActive(false); mBeerEmptyGO.GetComponent <SpriteRenderer> ().enabled = false; //mSpRendererBeerBootleFull = gameObject.GetComponent<SpriteRenderer> ().GetComponent<BierflascheVoll>(); // prepare sprite renderer SingletonData.Instance.globalClickWalkingIsDisabled = true; SingletonData.Instance.globalMouseHasBeenClicked = false; SingletonData.Instance.globalStoryInDalogue = true; mSingleton = new SingletonData(); mGuiBox = mTextControllerGO.GetComponent <GuiBox> (); mGuiBox.mStoryActionArrayList.Add("Willkommen im Spiel. Das ist das Tutorial"); mGuiBox.mStoryActionArrayList.Add("Suche den Kiosk um die mit der Bewegung vertraut zu machen!"); mGuiBox.mStoryActionArrayList.Add("_Action:moveCinemaBars"); mGuiBox.mStoryActionArrayList.Add("War doch falsch. Rechts gehts weiter."); mGuiBox.mStoryActionArrayList.Add("Duncan: Oh eine Flasch Bier. Die ist auch noch fast haltbar."); mGuiBox.mStoryActionArrayList.Add("_Action:activateWalking"); mGuiBox.mStoryActionArrayList.Add("Duncan:\nDas ist der lezte Text 1"); mGuiBox.mStoryActionArrayList.Add("Duncan:\nDas ist der lezte Text 2"); mGuiBox.mStoryActionArrayList.Add("Duncan:\nDas ist der lezte Text 3"); mGuiBox.mStoryActionArrayList.Add("Duncan:\nDas ist der lezte Text 4"); mGuiBox.mStoryActionArrayList.Add("_Action:changeToScene0"); mGuiBox.showBox(true); }
void Start() // Use this for initialization // displays a text in the inventory section { TextControllerGO = GameObject.Find("TextController"); ShowTextScript = TextControllerGO.GetComponent <ShowText>(); // displays a gui box which can be set visible or invisible GuiBoxGO = GameObject.Find("TextController"); GuiBoxScript = GuiBoxGO.GetComponent <GuiBox> (); // displays a debug console text line in the left upper corner GuiLabelGO = GameObject.Find("TextController"); GuiLabelScript = GuiLabelGO.GetComponent <GuiLabel> (); object1 = GameObject.Find("coins"); // code for java connection AndroidJNIHelper.debug = true; //AndroidJavaClass jc = new AndroidJavaClass("com.works.forme"); AndroidJavaObject jo = new AndroidJavaObject("com.works.forme.BlankFragment"); jo.CallStatic("showAd"); }