Ejemplo n.º 1
0
    void SetupUI()
    {
        FStage uiStage = new FStage("uiStage");

        timer    = new FLabel("Abstract", st.TimeStamp);
        bestTime = new FLabel("Abstract", "Best:\n" + st.TimeStamp);
        timer.SetAnchor(0, 1);
        timer.scale = 3;
        bestTime.SetAnchor(0, 1);
        bestTime.x     = Futile.screen.width - bestTime.textRect.width * 3;
        bestTime.scale = 3;
        uiStage.AddChild(timer);
        uiStage.AddChild(bestTime);
        Futile.AddStage(uiStage);
    }
Ejemplo n.º 2
0
    public void GoToPage(BPageType pageType)
    {
        if (_currentPageType == pageType)
        {
            return;                                      //we're already on the same page, so don't bother doing anything
        }
        BPage pageToCreate = null;

        if (pageType == BPageType.TitlePage)
        {
            pageToCreate = new BTitlePage();
        }
        else if (pageType == BPageType.InGamePage)
        {
            pageToCreate = new BInGamePage();
        }
        else if (pageType == BPageType.ScorePage)
        {
            pageToCreate = new BScorePage();
        }

        if (pageToCreate != null)        //destroy the old page and create a new one
        {
            _currentPageType = pageType;

            if (_currentPage != null)
            {
                _stage.RemoveChild(_currentPage);
            }

            _currentPage = pageToCreate;
            _stage.AddChild(_currentPage);
            _currentPage.Start();
        }
    }
Ejemplo n.º 3
0
    public void GoToPage(PageType pageType)
    {
        RXDebug.Log("Here i am changing the page");
        if (_currentPageType == pageType)
        {
            return;
        }

        Page pageToCreate = null;

        if (pageType == PageType.MenuPage)
        {
            pageToCreate = new MenuPage();
        }
        if (pageType == PageType.InGamePage)
        {
            pageToCreate = new InGamePage();
        }

        if (pageToCreate != null)
        {
            _currentPageType = pageType;

            if (_currentPage != null)
            {
                _stage.RemoveChild(_currentPage);
            }

            _currentPage = pageToCreate;
            _stage.AddChild(_currentPage);
            _currentPage.Start();
        }
    }
Ejemplo n.º 4
0
        public MonklandUI(FStage stage)
        {
            displayMessages = new List <QuickDisplayMessage>();
            uiLabels        = new List <FLabel>();
            worldStage      = stage;

            uiContainer = new FContainer();

            string text = "Monkland " + Monkland.VERSION;

            if (!MonklandSteamManager.DEBUG)
            {
                text = "";
            }

            statusLabel           = new FLabel("font", text);
            statusLabel.alignment = FLabelAlignment.Left;
            statusLabel.SetPosition(50.01f, Futile.screen.height - 49.99f);
            uiContainer.AddChild(statusLabel);

            for (int i = 0; i < 200; i++)
            {
                FLabel displayLabel = new FLabel("font", "");
                displayLabel.alignment = FLabelAlignment.Left;
                uiContainer.AddChild(displayLabel);
                uiLabels.Add(displayLabel);
            }

            displayMessages.Clear();
            stage.AddChild(uiContainer);
        }
Ejemplo n.º 5
0
    public void GoToMenu(PageType pageType)
    {
        if(currentPageType == pageType) return; // already on this menu

        // Get the stage
        stage_ = Futile.stage;

        // Remove the current page if it exists
        if(currentPage != null && stage_ != null){
            stage_.RemoveChild(currentPage);
        }

        // Set new page and page type
        switch(pageType){
        case PageType.TitlePage:
            currentPageType = PageType.TitlePage;
            currentPage = new TitlePage();
            break;
        case PageType.LevelSelectPage:
            currentPageType = PageType.LevelSelectPage;
            currentPage = new LevelSelectPage();
            break;
        case PageType.CreditsPage:
            currentPageType = PageType.CreditsPage;
            currentPage = new CreditsPage();
            break;
        }

        // Add the page and init it
        stage_.AddChild(currentPage);
        currentPage.Start();
    }
Ejemplo n.º 6
0
    public void GoToPage(PageType pageType)
    {
        Page pageToCreate = null;

        if (pageType == PageType.MainMenuPage)
        {
            pageToCreate = new MainMenuPage();
        }

        if (pageType == PageType.InGamePage)
        {
            pageToCreate = new InGamePage();
        }

        if (pageToCreate != null)
        {
            _currentPageType = pageType;

            if (_currentPage != null)
            {
                _stage.RemoveChild(_currentPage);
            }

            _currentPage = pageToCreate;
            _stage.AddChild(_currentPage);
            _currentPage.Start();
        }
    }
Ejemplo n.º 7
0
    void Start()
    {
        instance = this;

        //设置引擎参数
        FutileParams fparams = new FutileParams(true, true, true, false);

        fparams.AddResolutionLevel(1400f, 1f, 1f, string.Empty);
        fparams.origin = new Vector2(0.5f, 0.5f);          //RW原点在 0,0

        //初始化引擎
        Futile.instance.Init(fparams);

        //加载纹理资源
        this.tentaclePlants = Resources.Load("TPlantDemo_1") as Texture2D;
        Futile.atlasManager.LoadAtlasFromTexture("TPlantDemo_1", tentaclePlants);

        _stage = Futile.stage;
        Debug.Log("测试运行开始");
        //测试方法
        TestPage testPage = new TestPage();

        _stage.AddChild(testPage);
        testPage.Start();

        TestMethod();

        Debug.Log("测试路径读取:" + RootFolderDirectory());
    }
Ejemplo n.º 8
0
    public void HandleWin()
    {
        FStage UIstage = new FStage("UI");

        Futile.AddStage(UIstage);
        UIstage.AddChild(new FLabel("Abstract", string.Format("WINNER\nSAVED: {0}", c.PersonCount)));
        RemoveListenForUpdate();
    }
Ejemplo n.º 9
0
    public void HandleGameOver()
    {
        FStage UIstage = new FStage("UI");

        Futile.AddStage(UIstage);
        UIstage.AddChild(new FLabel("Abstract", "GAME OVER"));
        RemoveListenForUpdate();
    }
Ejemplo n.º 10
0
 public void ShowWinner()
 {
     winnerLbl           = new FLabel("Abadi55", Data.winner.ToString());
     winnerLbl.x         = (Screen.width / 2) - 100;
     winnerLbl.y         = 225;
     winnerLbl.alignment = FLabelAlignment.Center;
     stage.AddChild(winnerLbl);
 }
Ejemplo n.º 11
0
    private FSceneManager() : base()
    {
        mScenes = new List <FScene>();
        mStage  = Futile.stage;

        mStage.AddChild(this);

        mTransition = null;
    }
Ejemplo n.º 12
0
    private FSceneManager() : base()
    {
        mScenes       = new List <FScene>();
        mRemoveScenes = new List <FScene>();

        mStage = Futile.stage;

        mStage.AddChild(this);

        ListenForUpdate(HandleUpdate);
    }
Ejemplo n.º 13
0
    private FSceneManager()
        : base()
    {
        mScenes = new List<FScene>();
        mRemoveScenes = new List<FScene>();

        mStage = Futile.stage;

        mStage.AddChild( this );

        ListenForUpdate( HandleUpdate );
    }
    void Start()
    {
        instance = this;

        FutileParams fparams = new FutileParams(true, true, false, false);

        fparams.AddResolutionLevel(1280.0f, 1.0f, 1.0f, "");
        fparams.origin = new Vector2(0.5f, 0.5f);

        Futile.instance.Init(fparams);

        Futile.atlasManager.LoadAtlas("Atlases/CombatAtlas");

        Futile.atlasManager.LoadAtlas("Atlases/stomach_atlas");

        Futile.atlasManager.LoadAtlas("Atlases/lung_background");
        Futile.atlasManager.LoadAtlas("Atlases/lung_layers");
        Futile.atlasManager.LoadAtlas("Atlases/lung_dust");

        Futile.atlasManager.LoadAtlas("Atlases/BrainAtlas");
        Futile.atlasManager.LoadAtlas("Atlases/neuron_fast_80_animation");
        Futile.atlasManager.LoadAtlas("Atlases/neuron_fast_60_animation");
        Futile.atlasManager.LoadAtlas("Atlases/neuron_fast_40_animation");
        Futile.atlasManager.LoadAtlas("Atlases/neuron_slow_80_animation");
        Futile.atlasManager.LoadAtlas("Atlases/neuron_slow_60_animation");
        Futile.atlasManager.LoadAtlas("Atlases/neuron_slow_40_animation");

        Futile.atlasManager.LoadAtlas ("Atlases/Victory-DefeatAtlas");

        FSoundManager.PreloadSound("player_hit");
        FSoundManager.PreloadSound("bacteria_pop");

        Futile.atlasManager.LogAllElementNames();

        stage_ = Futile.stage;

        camera_ = new FCamObject();
        stage_.AddChild(camera_);

        //Rect worldBounds = stage.worldBounds;
        camera_.setWorldBounds (worldBounds);

        //make the camera follow the player

        camera_.setBounds(cameraBounds);

        gamePage = new CombatPage();
        gamePage.Start();
        camera_.AddChild(gamePage);
    }
Ejemplo n.º 15
0
 private static void AddBackground()
 {
     if (Futile.instance != null && Futile.instance.enabled == true)
     {
         if (tBackground == null)
         {
             tBackground        = new FSprite("blank");
             tBackground.color  = Color.grey;
             tBackground.width  = Futile.screen.width;
             tBackground.height = Futile.screen.height;
             tBackgroundStage.AddChild(tBackground);
             Futile.AddStageAtIndex(tBackgroundStage, 0);
         }
     }
 }
    void Start()
    {
        instance = this;

        FutileParams fparams = new FutileParams(true, true, false, false);

        fparams.AddResolutionLevel(1280.0f, 1.0f, 1.0f, "");
        fparams.origin = new Vector2(0.5f, 0.5f);

        Futile.instance.Init(fparams);

        Futile.atlasManager.LoadAtlas("Atlases/CombatAtlas");


        Futile.atlasManager.LoadAtlas("Atlases/stomach_atlas");

        Futile.atlasManager.LoadAtlas("Atlases/lung_background");
        Futile.atlasManager.LoadAtlas("Atlases/lung_layers");
        Futile.atlasManager.LoadAtlas("Atlases/lung_dust");

        Futile.atlasManager.LoadAtlas("Atlases/BrainAtlas");
        Futile.atlasManager.LoadAtlas("Atlases/neuron_fast_80_animation");
        Futile.atlasManager.LoadAtlas("Atlases/neuron_fast_60_animation");
        Futile.atlasManager.LoadAtlas("Atlases/neuron_fast_40_animation");
        Futile.atlasManager.LoadAtlas("Atlases/neuron_slow_80_animation");
        Futile.atlasManager.LoadAtlas("Atlases/neuron_slow_60_animation");
        Futile.atlasManager.LoadAtlas("Atlases/neuron_slow_40_animation");

        Futile.atlasManager.LoadAtlas("Atlases/Victory-DefeatAtlas");

        FSoundManager.PreloadSound("player_hit");
        FSoundManager.PreloadSound("bacteria_pop");

        Futile.atlasManager.LogAllElementNames();

        stage_ = Futile.stage;

        camera_ = new FCamObject();
        stage_.AddChild(camera_);

        //Rect worldBounds = stage.worldBounds;
        //camera_.setWorldBounds (worldBounds);
        //camera_.setBounds(stage.cameraBounds);

        gamePage = new CombatPage();
        gamePage.Start();
        camera_.AddChild(gamePage);
    }
Ejemplo n.º 17
0
    public World()
    {
        instance = this;

        isGameOver = false;

        root = FPWorld.Create(64.0f);

        AddChild(backParticles = new FParticleSystem(150));

        AddChild(chainHolder = new FContainer());
        AddChild(beastShadowHolder = new FContainer());
        AddChild(beastHolder = new FContainer());
        AddChild(effectHolder = new FContainer());

        AddChild(glowParticles = new FParticleSystem(150));
        glowParticles.shader = FShader.Additive;

        AddChild(orbHolder = new FContainer());

        uiStage = new FStage("UIStage");
        Futile.AddStage(uiStage);

        uiStage.scale = Futile.stage.scale;

        uiStage.AddChild(uiHolder = new FContainer());

        teams = GameManager.instance.activeTeams;

        InitBeasts();

        InitOrbs();

        InitUI();

        spawnRateMultiplier = 1.0f;

        walls = new Walls(this);

        ListenForUpdate(HandleUpdate);

        Input.ResetInputAxes();
    }
Ejemplo n.º 18
0
 public virtual void AddSprite(FSprite tSprite)
 {
     if (tSprite != null)
     {
         if (m_tSprites == null)
         {
             m_tSprites = new List <FNode>();
         }
         m_tSprites.Add(tSprite);
         if (m_tStage != null)
         {
             m_tStage.AddChild(tSprite);
         }
         else
         {
             Futile.stage.AddChild(tSprite);
         }
     }
 }
Ejemplo n.º 19
0
    public void GoToMenu(PageType pageType)
    {
        if (currentPageType == pageType)
        {
            return;                                     // already on this menu
        }
        // Get the stage
        stage_ = Futile.stage;

        // Remove the current page if it exists
        if (currentPage != null && stage_ != null)
        {
            stage_.RemoveChild(currentPage);
        }

        // Set new page and page type
        switch (pageType)
        {
        case PageType.TitlePage:
            currentPageType = PageType.TitlePage;
            currentPage     = new TitlePage();
            break;

        case PageType.LevelSelectPage:
            currentPageType = PageType.LevelSelectPage;
            currentPage     = new LevelSelectPage();
            break;

        case PageType.CreditsPage:
            currentPageType = PageType.CreditsPage;
            currentPage     = new CreditsPage();
            break;

        case PageType.HowToPlayPage:
            currentPageType = PageType.HowToPlayPage;
            currentPage     = new HowToPlayPage();
            break;
        }

        // Add the page and init it
        stage_.AddChild(currentPage);
        currentPage.Start();
    }
Ejemplo n.º 20
0
        public MonklandUI(FStage stage)
        {
            worldStage = stage;

            uiContainer = new FContainer();

            statusLabel           = new FLabel("font", "STATUSLABEL");
            statusLabel.alignment = FLabelAlignment.Left;
            statusLabel.SetPosition(50, Futile.screen.height - 50);
            uiContainer.AddChild(statusLabel);

            for (int i = 0; i < 200; i++)
            {
                FLabel displayLabel = new FLabel("font", string.Empty);
                uiContainer.AddChild(displayLabel);
                uiLabels.Add(displayLabel);
            }

            stage.AddChild(uiContainer);
        }
Ejemplo n.º 21
0
    public virtual void SetStage(FStage tStage)
    {
        if (m_tSprites != null)
        {
            foreach (FNode tNode in m_tSprites)
            {
                tNode.RemoveFromContainer();
                tStage.AddChild(tNode);
            }
        }
        m_tStage = tStage;

        if (m_tChildren != null)
        {
            foreach (UIElement tChild in m_tChildren)
            {
                tChild.SetStage(tStage);
            }
        }
    }
Ejemplo n.º 22
0
    void Start()
    {
        FutileParams fparams = new FutileParams(false, false, true, true);

        if (Screen.height == 2048)
        {
            fparams.AddResolutionLevel(Screen.width, 2.0f, 1.0f, "");
        }
        else
        {
            fparams.AddResolutionLevel(Screen.width, 1.0f, 1.0f, "");
        }

        fparams.origin = new Vector2(0, 0.5f);
        Futile.instance.Init(fparams);
        stage = Futile.stage;
        Futile.atlasManager.LoadAtlas("Atlases/bocaraButtons");
        Futile.atlasManager.LoadFont("AbadiBlue", "AbadiBlue", "Atlases/AbadiBlue", 0.0f, 0.0f);
        Futile.atlasManager.LoadFont("AbadiRed", "AbadiRed", "Atlases/AbadiRed", 0.0f, 0.0f);
        Futile.atlasManager.LoadFont("Abadi55", "Abadi55", "Atlases/Abadi55", 0.0f, 0.0f);

        controllerManager = GameObject.FindGameObjectWithTag("ControllerManager").GetComponent <ControllerManager>();

        //1.Create futile layer.
        //2.Set the Futile object to use the Futile new layer.
        //3. Add lines to Futile.cs line 122
        //Esteban: to use Futile as UI
        //_camera.cullingMask = (1 << 11);
        //4. Comment the line on Futile.cs
        //_camera.clearFlags = CameraClearFlags.SolidColor;
        //5. Uncomment the line on Futile.cs
        //_camera.clearFlags = CameraClearFlags.Depth; //TODO: check if this is faster or not?
        //6. Add to FFacetRenderLayer line 60
        //_gameObject.layer = 11;
        //_stage.layer = 11;

        int xpos = (int)Futile.screen.width / 2;
        int ypos = 0;

        ypos              += 50;
        titleLbl           = new FLabel("AbadiRed", "Welcome Bobies");
        titleLbl.x         = xpos;
        titleLbl.y         = ypos;
        titleLbl.alignment = FLabelAlignment.Center;
        stage.AddChild(titleLbl);

        ypos                     = 0;
        descriptionLbl           = new FLabel("AbadiBlue", "On this game player need to manage the world resources\nwhile trying to destroy the other players buildings and weapons.");
        descriptionLbl.x         = xpos;
        descriptionLbl.y         = ypos;
        descriptionLbl.alignment = FLabelAlignment.Center;
        stage.AddChild(descriptionLbl);

        ypos   -= 75;
        playBtn = new FButton("idleBlueBtn_tex", "overBlueBtn_tex");
        playBtn.AddLabel("AbadiBlue", "PLAY", Color.white);
        playBtn.x              = xpos;
        playBtn.y              = ypos;
        playBtn.SignalRelease += OnButtonHandle;
        stage.AddChild(playBtn);
    }
    void Start()
    {
        instance = this;

        FutileParams fparams = new FutileParams(true, true, false, false);

        fparams.AddResolutionLevel(1280.0f, 1.0f, 1.0f, "");
        fparams.origin = new Vector2(0.5f, 0.5f);

        Futile.instance.Init(fparams);

        Futile.atlasManager.LoadAtlas("Atlases/HuroCombatAtlas");
        Futile.atlasManager.LoadAtlas("Atlases/EnemyCombatAtlas");

        if (stage_name.Equals("stomach"))
        {
            Futile.atlasManager.LoadAtlas("Atlases/StomachAtlas1");
            Futile.atlasManager.LoadAtlas("Atlases/StomachAtlas2");
        }
        else if (stage_name.Equals("lung"))
        {
            Futile.atlasManager.LoadAtlas("Atlases/LungBackground1");
            Futile.atlasManager.LoadAtlas("Atlases/LungBackground2");
            Futile.atlasManager.LoadAtlas("Atlases/LungBackground3");
            Futile.atlasManager.LoadAtlas("Atlases/LungBackground4");
            Futile.atlasManager.LoadAtlas("Atlases/LungBackground5");

            Futile.atlasManager.LoadAtlas("Atlases/lung_layers");
            Futile.atlasManager.LoadAtlas("Atlases/DustRear");
            Futile.atlasManager.LoadAtlas("Atlases/DustMid");
            Futile.atlasManager.LoadAtlas("Atlases/DustFore");
        }
        else
        {
            Futile.atlasManager.LoadAtlas("Atlases/BrainAtlas");
            Futile.atlasManager.LoadAtlas("Atlases/neuron_fast_80_animation");
            Futile.atlasManager.LoadAtlas("Atlases/neuron_fast_60_animation");
            Futile.atlasManager.LoadAtlas("Atlases/neuron_fast_40_animation");
            Futile.atlasManager.LoadAtlas("Atlases/neuron_slow_80_animation");
            Futile.atlasManager.LoadAtlas("Atlases/neuron_slow_60_animation");
            Futile.atlasManager.LoadAtlas("Atlases/neuron_slow_40_animation");
        }

        Futile.atlasManager.LoadAtlas("Atlases/MenuWords");
        Futile.atlasManager.LoadAtlas("Atlases/VictoryDefeatAtlas");

        FSoundManager.PreloadSound("player_hit");
        FSoundManager.PreloadSound("bacteria_pop");
        FSoundManager.PreloadSound("enemy_hit");

        Futile.atlasManager.LogAllElementNames();

        stage_ = Futile.stage;

        camera_ = new FCamObject();
        stage_.AddChild(camera_);

        //Rect worldBounds = stage.worldBounds;
        //camera_.setWorldBounds (worldBounds);
        //camera_.setBounds(stage.cameraBounds);

        gamePage = new CombatPage();
        gamePage.Start();
        camera_.AddChild(gamePage);
    }
Ejemplo n.º 24
0
    private void Start()
    {
        instance = this;

        bool isIPad = SystemInfo.deviceModel.Contains("iPad");
        bool shouldSupportPortraitUpsideDown = isIPad; //only support portrait upside-down on iPad

        FutileParams fparams = new FutileParams(true,true,true,shouldSupportPortraitUpsideDown);

        fparams.AddResolutionLevel(480.0f,	1.0f,	1.0f,	"_Scale1"); //iPhone
        fparams.AddResolutionLevel(960.0f,	2.0f,	2.0f,	"_Scale2"); //iPhone 4 retina
        fparams.AddResolutionLevel(1024.0f,	2.0f,	2.0f,	"_Scale2"); //iPad and iPad Mini
        fparams.AddResolutionLevel(1136.0f,	2.0f,	2.0f,	"_Scale2"); //iPhone 5 retina
        fparams.AddResolutionLevel(1280.0f,	2.0f,	2.0f,	"_Scale2"); //Nexus 7
        fparams.AddResolutionLevel(2048.0f,	4.0f,	4.0f,	"_Scale4"); //iPad Retina

        fparams.origin = new Vector2(0.5f,0.5f);

        Futile.instance.Init (fparams);

        Futile.atlasManager.LoadAtlas("Atlases/Atlas");
        Futile.atlasManager.LoadFont("Franchise","FranchiseFont" + Futile.resourceSuffix, "Atlases/FranchiseFont" + Futile.resourceSuffix, -2.0f,-5.0f);

        stage = Futile.stage;

        showMenu();

        stats = new Stats();
        stage.AddChild( stats );
    }
Ejemplo n.º 25
0
    void AddRedPlayerUI()
    {
        int xpos = 30;
        int ypos = 0;

        buildingRedBtn                = new FButton("buildingRedBtn_tex");
        buildingRedBtn.x              = xpos;
        buildingRedBtn.y              = ypos;
        buildingRedBtn.SignalRelease += OnButtonHandle;
        stage.AddChild(buildingRedBtn);

        ypos                       -= 45;
        energyRedBtn                = new FButton("energyRedBtn_tex");
        energyRedBtn.x              = xpos;
        energyRedBtn.y              = ypos;
        energyRedBtn.SignalRelease += OnButtonHandle;
        stage.AddChild(energyRedBtn);

        ypos                     -= 45;
        woodRedBtn                = new FButton("woodRedBtn_tex");
        woodRedBtn.x              = xpos;
        woodRedBtn.y              = ypos;
        woodRedBtn.SignalRelease += OnButtonHandle;
        stage.AddChild(woodRedBtn);

        ypos                      -= 45;
        stoneRedBtn                = new FButton("stoneRedBtn_tex");
        stoneRedBtn.x              = xpos;
        stoneRedBtn.y              = ypos;
        stoneRedBtn.SignalRelease += OnButtonHandle;
        stage.AddChild(stoneRedBtn);

        ypos                      -= 45;
        metalRedBtn                = new FButton("metalRedBtn_tex");
        metalRedBtn.x              = xpos;
        metalRedBtn.y              = ypos;
        metalRedBtn.SignalRelease += OnButtonHandle;
        stage.AddChild(metalRedBtn);

        ypos                        -= 45;
        missileRedBtn                = new FButton("missileRedBtn_tex");
        missileRedBtn.x              = xpos;
        missileRedBtn.y              = ypos;
        missileRedBtn.SignalRelease += OnButtonHandle;
        stage.AddChild(missileRedBtn);

        ypos                        -= 45;
        factoryRedBtn                = new FButton("factoryRedBtn_tex");
        factoryRedBtn.x              = xpos;
        factoryRedBtn.y              = ypos;
        factoryRedBtn.SignalRelease += OnButtonHandle;
        stage.AddChild(factoryRedBtn);

        ypos                         -= 45;
        defenderRedBtn                = new FButton("defenderRedBtn_tex");
        defenderRedBtn.x              = xpos;
        defenderRedBtn.y              = ypos;
        defenderRedBtn.SignalRelease += OnButtonHandle;
        stage.AddChild(defenderRedBtn);

        ypos                    -= 45;
        labRedBtn                = new FButton("labRedBtn_tex");
        labRedBtn.x              = xpos;
        labRedBtn.y              = ypos;
        labRedBtn.SignalRelease += OnButtonHandle;
        stage.AddChild(labRedBtn);

        xpos                    = 55;
        ypos                    = 0;
        citizenRedLbl           = new FLabel("AbadiRed", "12231");
        citizenRedLbl.alignment = FLabelAlignment.Left;
        citizenRedLbl.x         = xpos;
        citizenRedLbl.y         = ypos;
        stage.AddChild(citizenRedLbl);

        ypos                  -= 45;
        energyRedLbl           = new FLabel("AbadiRed", "0");
        energyRedLbl.alignment = FLabelAlignment.Left;
        energyRedLbl.x         = xpos;
        energyRedLbl.y         = ypos;
        stage.AddChild(energyRedLbl);

        ypos                -= 45;
        woodRedLbl           = new FLabel("AbadiRed", "0");
        woodRedLbl.alignment = FLabelAlignment.Left;
        woodRedLbl.x         = xpos;
        woodRedLbl.y         = ypos;
        stage.AddChild(woodRedLbl);

        ypos                 -= 45;
        stoneRedLbl           = new FLabel("AbadiRed", "0");
        stoneRedLbl.alignment = FLabelAlignment.Left;
        stoneRedLbl.x         = xpos;
        stoneRedLbl.y         = ypos;
        stage.AddChild(stoneRedLbl);

        ypos                 -= 45;
        metalRedLbl           = new FLabel("AbadiRed", "0");
        metalRedLbl.alignment = FLabelAlignment.Left;
        metalRedLbl.x         = xpos;
        metalRedLbl.y         = ypos;
        stage.AddChild(metalRedLbl);

        ypos                   -= 45;
        missileRedLbl           = new FLabel("AbadiRed", "0");
        missileRedLbl.alignment = FLabelAlignment.Left;
        missileRedLbl.x         = xpos;
        missileRedLbl.y         = ypos;
        stage.AddChild(missileRedLbl);
    }
Ejemplo n.º 26
0
    private void Start()
    {
        instance = this;

        Go.defaultEaseType = EaseType.Linear;
        Go.duplicatePropertyRule = DuplicatePropertyRuleType.RemoveRunningProperty;

        //Screen.showCursor = false;

        //Time.timeScale = 0.1f;

        bool landscape = true;
        bool portrait = false;

        bool isIPad = SystemInfo.deviceModel.Contains("iPad");
        bool shouldSupportPortraitUpsideDown = isIPad && portrait; //only support portrait upside-down on iPad

        FutileParams fparams = new FutileParams(landscape, landscape, portrait, shouldSupportPortraitUpsideDown);

        fparams.backgroundColor = RXUtils.GetColorFromHex(0x000000); //light blue 0x94D7FF or 0x74CBFF

        //fparams.AddResolutionLevel(2560.0f,	2.0f,	2.0f,	""); //1280x720
        //fparams.AddResolutionLevel(1280.0f,	1.0f,	2.0f,	""); //1280x720
        fparams.AddResolutionLevel(1920.0f,	1.5f,	2.0f,	""); //1920x1080
        fparams.AddResolutionLevel(960.0f,	0.75f,	2.0f,	""); //960x540

        fparams.origin = new Vector2(0.5f,0.5f);

        Futile.instance.Init (fparams);

        Futile.atlasManager.LoadAtlas("Atlases/UIAtlas");
        Futile.atlasManager.LoadAtlas("Atlases/UIFonts");
        Futile.atlasManager.LoadAtlas("Atlases/BackgroundAtlas");
        Futile.atlasManager.LoadAtlas("Atlases/GameAtlas");

        FTextParams textParams;

        textParams = new FTextParams();
        textParams.lineHeightOffset = -8.0f;
        Futile.atlasManager.LoadFont("Franchise","FranchiseFont", "Atlases/FranchiseFont", -2.0f,-5.0f,textParams);

        textParams = new FTextParams();
        textParams.kerningOffset = -0.5f;
        textParams.lineHeightOffset = -8.0f;
        Futile.atlasManager.LoadFont("CubanoInnerShadow","Cubano_InnerShadow", "Atlases/CubanoInnerShadow", 0.0f,2.0f,textParams);

        textParams = new FTextParams();
        textParams.lineHeightOffset = -8.0f;
        textParams.kerningOffset = -0.5f;
        Futile.atlasManager.LoadFont("CubanoBig","Cubano136", "Atlases/Cubano136", 0.0f,2.0f,textParams);

        GamepadManager.Init();
        GameManager.Init();

        _stage = Futile.stage;

        _stage.AddChild(background = new Background());

        GoToPage(TPageType.PagePlayerSelect);

        _stage.ListenForUpdate (HandleUpdate);

        FSoundManager.isMuted = !GameConfig.IS_SOUND_ON;

        _stage.ListenForResize(HandleResize);
    }
    void Start()
    {
        instance = this;

        FutileParams fparams = new FutileParams(true, true, false, false);

        fparams.AddResolutionLevel(1280.0f, 1.0f, 1.0f, "");
        fparams.origin = new Vector2(0.5f, 0.5f);

        Futile.instance.Init(fparams);

        Futile.atlasManager.LoadAtlas("Atlases/HuroCombatAtlas");
        Futile.atlasManager.LoadAtlas("Atlases/EnemyCombatAtlas");

        if(stage_name.Equals("stomach"))
        {
            Futile.atlasManager.LoadAtlas("Atlases/StomachAtlas1");
            Futile.atlasManager.LoadAtlas("Atlases/StomachAtlas2");
        }
        else if(stage_name.Equals("lung"))
        {
            Futile.atlasManager.LoadAtlas("Atlases/LungBackground1");
            Futile.atlasManager.LoadAtlas("Atlases/LungBackground2");
            Futile.atlasManager.LoadAtlas("Atlases/LungBackground3");
            Futile.atlasManager.LoadAtlas("Atlases/LungBackground4");
            Futile.atlasManager.LoadAtlas("Atlases/LungBackground5");

            Futile.atlasManager.LoadAtlas("Atlases/lung_layers");
            Futile.atlasManager.LoadAtlas("Atlases/DustRear");
            Futile.atlasManager.LoadAtlas("Atlases/DustMid");
            Futile.atlasManager.LoadAtlas("Atlases/DustFore");

        }
        else
        {
            Futile.atlasManager.LoadAtlas("Atlases/BrainAtlas");
            Futile.atlasManager.LoadAtlas("Atlases/neuron_fast_80_animation");
            Futile.atlasManager.LoadAtlas("Atlases/neuron_fast_60_animation");
            Futile.atlasManager.LoadAtlas("Atlases/neuron_fast_40_animation");
            Futile.atlasManager.LoadAtlas("Atlases/neuron_slow_80_animation");
            Futile.atlasManager.LoadAtlas("Atlases/neuron_slow_60_animation");
            Futile.atlasManager.LoadAtlas("Atlases/neuron_slow_40_animation");
        }

        Futile.atlasManager.LoadAtlas("Atlases/MenuWords");
        Futile.atlasManager.LoadAtlas ("Atlases/VictoryDefeatAtlas");

        FSoundManager.PreloadSound("player_hit");
        FSoundManager.PreloadSound("bacteria_pop");
        FSoundManager.PreloadSound("enemy_hit");

        Futile.atlasManager.LogAllElementNames();

        stage_ = Futile.stage;

        camera_ = new FCamObject();
        stage_.AddChild(camera_);

        //Rect worldBounds = stage.worldBounds;
        //camera_.setWorldBounds (worldBounds);
        //camera_.setBounds(stage.cameraBounds);

        gamePage = new CombatPage();
        gamePage.Start();
        camera_.AddChild(gamePage);
    }