コード例 #1
0
    public PlayerSelectPage()
    {
        bg       = new FSprite("Arena/BG_1");
        bg.color = new Color(0.5f, 0.5f, 0.5f, 1.0f);
        AddChild(bg);

        statusLabel       = new DualLabel(TOFonts.MEDIUM_BOLD, "");
        statusLabel.scale = 1f;
        statusLabel.SetPosition(0, -Config.HEIGHT / 2 + 27);
        AddChild(statusLabel);

        float spreadControlX = Config.WIDTH / 2 - 74.0f;

        DualLabel wolfLabel = new DualLabel(TOFonts.MEDIUM_BOLD, "WOLF (night):\n\nTAP ANY BUTTON\nTO ATTACK\n\n\nHUMAN (day):\n\nRUN FOR\nYOUR LIFE");

        wolfLabel.mainLabel.color = new Color(1.0f, 0.7f, 0.7f);
        wolfLabel.x = -spreadControlX;
        AddChild(wolfLabel);

        DualLabel villLabel = new DualLabel(TOFonts.MEDIUM_BOLD, "VILLAGERS:\n\nRUN AWAY\nAT NIGHT\n\nHOLD ANY BUTTON\nTO SPREAD OUT\n\nCAN HOP\nOVER FENCES");

        villLabel.mainLabel.color = new Color(0.8f, 0.8f, 1.0f);
        villLabel.x = spreadControlX;
        AddChild(villLabel);

        logo = new FSprite("Arena/Logo");
        AddChild(logo);

        logo.y = Config.HEIGHT / 2 - 43.0f;

        ListenForUpdate(Update);

        UpdateStatus();
    }
コード例 #2
0
ファイル: SimpleButton.cs プロジェクト: MattRix/BewareWolf
    public SimpleButton(string title, float width, float height, SimpleButtonColor color, bool isPressTap, string fontName)
    {
        _isPressTap        = isPressTap;
        this.effectManager = Core.topEffectManager;

        _color          = color;
        AddChild(button = new FSliceButton(width, height, _color.path, _color.path));

        //button.SetPosition(0.25f,0.33f);//pixel perfect?

        AddChild(mainLabel = new DualLabel(fontName, title, Color.white, TOColors.TEXT_SHADOW));
        mainLabel.y        = 2.5f;

        if (_isPressTap)
        {
            button.SignalPress += (b) => DoTap();
        }
        else
        {
            button.SignalRelease += (b) => DoTap();
        }

        _overHighlight       = new FSliceSprite("UI/ButtonHighlight", width, height, 12, 12, 12, 12);
        _overHighlight.alpha = 0.45f;


        ListenForUpdate(HandleUpdate);

        UpdateEnabled();
    }
コード例 #3
0
ファイル: SimpleButton.cs プロジェクト: BoarK/BewareWolf
    public SimpleButton(string title, float width, float height, SimpleButtonColor color, bool isPressTap,string fontName)
    {
        _isPressTap = isPressTap;
        this.effectManager = Core.topEffectManager;

        _color = color;
        AddChild(button = new FSliceButton(width,height,_color.path,_color.path));

        //button.SetPosition(0.25f,0.33f);//pixel perfect?

        AddChild(mainLabel = new DualLabel(fontName,title,Color.white,TOColors.TEXT_SHADOW));
        mainLabel.y = 2.5f;

        if(_isPressTap)
        {
            button.SignalPress += (b) => DoTap();
        }
        else
        {
            button.SignalRelease += (b) => DoTap();
        }

        _overHighlight = new FSliceSprite("UI/ButtonHighlight",width,height,12,12,12,12);
        _overHighlight.alpha = 0.45f;

        ListenForUpdate(HandleUpdate);

        UpdateEnabled();
    }
コード例 #4
0
ファイル: DayManager.cs プロジェクト: MattRix/BewareWolf
    void ShowMessage(string title, string message, Color color)
    {
        FContainer callout = new FContainer();

        callout.scale = 0.5f;

        DualLabel titleLabel = new DualLabel(TOFonts.MEDIUM_BOLD, title);

        callout.AddChild(titleLabel);
        titleLabel.mainLabel.color = color;
        titleLabel.scale           = 4.0f;
        titleLabel.y              = 20.0f;
        titleLabel.shadowLabel.y += 0.5f;

        DualLabel messageLabel = new DualLabel(TOFonts.MEDIUM_BOLD, message);

        callout.AddChild(messageLabel);
        messageLabel.mainLabel.color = color;
        messageLabel.scale           = 2.0f;
        messageLabel.y = -16.0f;

        Arena.instance.frontContainer.AddChild(callout);

        titleLabel.alpha   = 0;
        messageLabel.alpha = 0;

        Go.to(titleLabel, 0.5f, new TweenConfig().alpha(1.0f));
        Go.to(messageLabel, 0.5f, new TweenConfig().alpha(1.0f));

        Go.to(callout, 3.0f, new TweenConfig().y(10.0f).removeWhenComplete());
        Go.to(callout, 0.8f, new TweenConfig().setDelay(2.2f).alpha(0.0f));
    }
コード例 #5
0
ファイル: MultiDualLabel.cs プロジェクト: BoarK/BewareWolf
 public DualLabel AddLabel(DualLabel label)
 {
     labels.Add(label);
     label.SetAnchor(0.0f,0.5f);
     AddChild(label);
     return label;
 }
コード例 #6
0
ファイル: MultiDualLabel.cs プロジェクト: MattRix/BewareWolf
 public DualLabel AddLabel(DualLabel label)
 {
     labels.Add(label);
     label.SetAnchor(0.0f, 0.5f);
     AddChild(label);
     return(label);
 }
コード例 #7
0
ファイル: SimpleButton.cs プロジェクト: MattRix/BewareWolf
    public DualLabel AddSubLabel(DualLabel subLabel, float mainOffsetY, float subOffsetY)
    {
        this.subLabel = subLabel;
        AddChild(subLabel);

        mainLabel.y += mainOffsetY;
        subLabel.y  += subOffsetY;

        UpdateEnabled();

        return(subLabel);
    }
コード例 #8
0
ファイル: Arena.cs プロジェクト: MattRix/BewareWolf
    public void ShowDeadMessage(ActivePlayer player)
    {
        FContainer callout = new FContainer();

        callout.scale = 0.5f;

        MultiDualLabel fullLabel = new MultiDualLabel();

        callout.AddChild(fullLabel);

        DualLabel colorLabel = new DualLabel(TOFonts.MEDIUM_BOLD, player.player.color.name.ToUpper());

        colorLabel.mainLabel.color = player.player.color.color;
        colorLabel.scale           = 4.0f;

        DualLabel messageLabel = new DualLabel(TOFonts.MEDIUM_BOLD, " WAS ELIMINATED!");

        callout.AddChild(messageLabel);
        messageLabel.mainLabel.color = Color.white;
        messageLabel.scale           = 4.0f;

        //smaller shadow
        colorLabel.mainLabel.y   += 0.5f;
        messageLabel.mainLabel.y += 0.5f;

        fullLabel.AddLabel(colorLabel);
        fullLabel.AddLabel(messageLabel);
        fullLabel.Align(0.5f);

        Arena.instance.frontContainer.AddChild(callout);

        fullLabel.alpha = 0.0f;

        Go.to(fullLabel, 0.5f, new TweenConfig().alpha(1.0f));

        callout.y = Config.HEIGHT / 2 - 26.0f;

        Go.to(callout, 3.0f, new TweenConfig().y(callout.y + 5.0f).removeWhenComplete());
        Go.to(callout, 0.8f, new TweenConfig().setDelay(2.2f).alpha(0.0f));
    }
コード例 #9
0
ファイル: GameOverScreen.cs プロジェクト: BoarK/BewareWolf
    public GameOverScreen(bool didWolfWin)
    {
        bg = new FSprite("WhiteBox");
        bg.color = Color.black.CloneWithNewAlpha(0.7f);
        AddChild(bg);
        bg.width = Config.WIDTH;
        bg.height = Config.HEIGHT;

        string message = didWolfWin ? "WEREWOLVES WIN!" : "VILLAGERS WIN!";

        label = new DualLabel(TOFonts.MEDIUM_BOLD,message);

        label.scale = 4.0f;
        label.mainLabel.y += 0.25f;
        AddChild(label);
        label.y += 7;

        DualLabel sub = new DualLabel(TOFonts.MEDIUM_BOLD,"PRESS [START] or [R] TO RESTART");
        sub.scale = 2.0f;
        sub.y -= 22.0f;
        AddChild(sub);
    }
コード例 #10
0
    public GameOverScreen(bool didWolfWin)
    {
        bg       = new FSprite("WhiteBox");
        bg.color = Color.black.CloneWithNewAlpha(0.7f);
        AddChild(bg);
        bg.width  = Config.WIDTH;
        bg.height = Config.HEIGHT;

        string message = didWolfWin ? "WEREWOLVES WIN!" : "VILLAGERS WIN!";

        label = new DualLabel(TOFonts.MEDIUM_BOLD, message);

        label.scale        = 4.0f;
        label.mainLabel.y += 0.25f;
        AddChild(label);
        label.y += 7;

        DualLabel sub = new DualLabel(TOFonts.MEDIUM_BOLD, "PRESS [START] or [R] TO RESTART");

        sub.scale = 2.0f;
        sub.y    -= 22.0f;
        AddChild(sub);
    }
コード例 #11
0
    public TeamCol(Team team)
    {
        this.team = team;

        label       = new DualLabel(TOFonts.MEDIUM_BOLD, team.name.ToUpper());
        label.alpha = 0.5f;
        label.scale = 1.5f;
        AddChild(label);

        bool isNone = team == PlayerManager.Team_None;

        bgRect = new RoundedRect(WIDTH, HEIGHT, !isNone);
        AddChild(bgRect);

        if (isNone)
        {
            bgRect.width -= 25;
            bgRect.alpha  = 0.2f;
        }

        label.mainLabel.color = team.color;
        bgRect.color          = team.color;
    }
コード例 #12
0
ファイル: SimpleButton.cs プロジェクト: BoarK/BewareWolf
    public DualLabel AddSubLabel(DualLabel subLabel, float mainOffsetY, float subOffsetY)
    {
        this.subLabel = subLabel;
        AddChild(subLabel);

        mainLabel.y += mainOffsetY;
        subLabel.y += subOffsetY;

        UpdateEnabled();

        return subLabel;
    }
コード例 #13
0
ファイル: MultiDualLabel.cs プロジェクト: BoarK/BewareWolf
 public DualLabel RemoveLabel(DualLabel label)
 {
     label.RemoveFromContainer();
     labels.Remove(label);
     return label;
 }
コード例 #14
0
ファイル: MultiDualLabel.cs プロジェクト: MattRix/BewareWolf
 public DualLabel RemoveLabel(DualLabel label)
 {
     label.RemoveFromContainer();
     labels.Remove(label);
     return(label);
 }
コード例 #15
0
ファイル: DayManager.cs プロジェクト: BoarK/BewareWolf
    void ShowMessage(string title, string message, Color color)
    {
        FContainer callout = new FContainer();
        callout.scale = 0.5f;

        DualLabel titleLabel = new DualLabel(TOFonts.MEDIUM_BOLD,title);
        callout.AddChild(titleLabel);
        titleLabel.mainLabel.color = color;
        titleLabel.scale = 4.0f;
        titleLabel.y = 20.0f;
        titleLabel.shadowLabel.y += 0.5f;

        DualLabel messageLabel = new DualLabel(TOFonts.MEDIUM_BOLD,message);
        callout.AddChild(messageLabel);
        messageLabel.mainLabel.color = color;
        messageLabel.scale = 2.0f;
        messageLabel.y = -16.0f;

        Arena.instance.frontContainer.AddChild(callout);

        titleLabel.alpha = 0;
        messageLabel.alpha = 0;

        Go.to(titleLabel, 0.5f, new TweenConfig().alpha(1.0f));
        Go.to(messageLabel, 0.5f, new TweenConfig().alpha(1.0f));

        Go.to(callout, 3.0f, new TweenConfig().y(10.0f).removeWhenComplete());
        Go.to(callout,0.8f,new TweenConfig().setDelay(2.2f).alpha(0.0f));
    }
コード例 #16
0
ファイル: Arena.cs プロジェクト: BoarK/BewareWolf
    public void ShowDeadMessage(ActivePlayer player)
    {
        FContainer callout = new FContainer();
        callout.scale = 0.5f;

        MultiDualLabel fullLabel = new MultiDualLabel();
        callout.AddChild(fullLabel);

        DualLabel colorLabel = new DualLabel(TOFonts.MEDIUM_BOLD,player.player.color.name.ToUpper());
        colorLabel.mainLabel.color = player.player.color.color;
        colorLabel.scale = 4.0f;

        DualLabel messageLabel = new DualLabel(TOFonts.MEDIUM_BOLD," WAS ELIMINATED!");
        callout.AddChild(messageLabel);
        messageLabel.mainLabel.color = Color.white;
        messageLabel.scale = 4.0f;

        //smaller shadow
        colorLabel.mainLabel.y += 0.5f;
        messageLabel.mainLabel.y += 0.5f;

        fullLabel.AddLabel(colorLabel);
        fullLabel.AddLabel(messageLabel);
        fullLabel.Align(0.5f);

        Arena.instance.frontContainer.AddChild(callout);

        fullLabel.alpha = 0.0f;

        Go.to(fullLabel, 0.5f, new TweenConfig().alpha(1.0f));

        callout.y = Config.HEIGHT/2 - 26.0f;

        Go.to(callout, 3.0f, new TweenConfig().y(callout.y+5.0f).removeWhenComplete());
        Go.to(callout,0.8f,new TweenConfig().setDelay(2.2f).alpha(0.0f));
    }
コード例 #17
0
ファイル: PlayerSelectPage.cs プロジェクト: BoarK/BewareWolf
    public PlayerSelectPage()
    {
        bg = new FSprite("Arena/BG_1");
        bg.color = new Color(0.5f,0.5f,0.5f,1.0f);
        AddChild(bg);

        statusLabel = new DualLabel(TOFonts.MEDIUM_BOLD,"");
        statusLabel.scale = 1f;
        statusLabel.SetPosition(0,-Config.HEIGHT/2+27);
        AddChild(statusLabel);

        float spreadControlX = Config.WIDTH/2 - 74.0f;

        DualLabel wolfLabel = new DualLabel(TOFonts.MEDIUM_BOLD,"WOLF (night):\n\nTAP ANY BUTTON\nTO ATTACK\n\n\nHUMAN (day):\n\nRUN FOR\nYOUR LIFE");
        wolfLabel.mainLabel.color = new Color(1.0f,0.7f,0.7f);
        wolfLabel.x = -spreadControlX;
        AddChild(wolfLabel);

        DualLabel villLabel = new DualLabel(TOFonts.MEDIUM_BOLD,"VILLAGERS:\n\nRUN AWAY\nAT NIGHT\n\nHOLD ANY BUTTON\nTO SPREAD OUT\n\nCAN HOP\nOVER FENCES");
        villLabel.mainLabel.color = new Color(0.8f,0.8f,1.0f);
        villLabel.x = spreadControlX;
        AddChild(villLabel);

        logo = new FSprite("Arena/Logo");
        AddChild(logo);

        logo.y = Config.HEIGHT/2 - 43.0f;

        ListenForUpdate(Update);

        UpdateStatus();
    }
コード例 #18
0
ファイル: PlayerSelectPage.cs プロジェクト: BoarK/BewareWolf
    public TeamCol(Team team)
    {
        this.team = team;

        label = new DualLabel(TOFonts.MEDIUM_BOLD,team.name.ToUpper());
        label.alpha = 0.5f;
        label.scale = 1.5f;
        AddChild(label);

        bool isNone = team == PlayerManager.Team_None;

        bgRect = new RoundedRect(WIDTH,HEIGHT,!isNone);
        AddChild(bgRect);

        if(isNone)
        {
            bgRect.width -= 25;
            bgRect.alpha = 0.2f;
        }

        label.mainLabel.color = team.color;
        bgRect.color = team.color;
    }