Example #1
0
    private void Update()
    {
        if (current_lock_time > 0)
        {
            current_lock_time -= Time.deltaTime;

            float red_tint = current_lock_time / fail_lock_time;
            display_text_object.SetRedTint(red_tint);
            display_text_object.SetText("Error!");
        }
        else
        {
            display_text_object.SetText("Type");
        }
    }
        public override void WillActivate()
        {
            base.WillActivate();

            var hour = DateTime.Now.Hour;

            var display = "zzzz";

            if (hour < 6)
            {
                // zzz
            }
            else if (hour < 10)
            {
                display = "Breakfast time";
            }
            else if (hour < 16)
            {
                display = "Lunch time";
            }
            else if (hour < 21)
            {
                display = "Dinner time";
            }
            else if (hour < 23)
            {
                display = "Bed time";
            }
            var localizedDisplay = NSBundle.MainBundle.LocalizedString(display, comment: "greeting");

            DisplayText.SetText(localizedDisplay);

            try
            {
                // "*****@*****.**" is located in the Watch Extension
                // multiple times: once for each language .lproj directory
                using (var image = UIImage.FromBundle("language"))
                {
                    //	DisplayImage.SetImage(image);
                }
            }
            catch (Exception ex) {
                DisplayText.SetText("Exception: " + ex.Message);
            }

            // easiest way to format date and/or time
            var localizedDateTime = NSDateFormatter.ToLocalizedString
                                        (NSDate.Now, NSDateFormatterStyle.Long, NSDateFormatterStyle.Short);

            DisplayTime.SetText(localizedDateTime);


            // long way of date or time formatting
            //			var formatter = new NSDateFormatter ();
            //			formatter.DateStyle = NSDateFormatterStyle.Medium;
            //			formatter.TimeStyle = NSDateFormatterStyle.Long;
            //			formatter.Locale = NSLocale.CurrentLocale;
            //			var localizedDateTime = formatter.StringFor (NSDate.Now);
        }
Example #3
0
    ///// <summary>
    ///// 根据内容大小类型,进行加工
    ///// </summary>
    ///// <param name="go_display"></param>
    ///// <param name="SizeType"></param>
    //private void ModifyBySizeType(DisplayText go_display, TextDisplaySizeType SizeType)
    //{

    //    switch (SizeType)
    //    {
    //        case TextDisplaySizeType.Small: go_display.ChangeFontSize( 75); break;
    //        case TextDisplaySizeType.Middle: go_display.ChangeFontSize(105); break;
    //        case TextDisplaySizeType.Large: go_display.ChangeFontSize(190); break;
    //        case TextDisplaySizeType.Critical: go_display.ChangeFontSize(315); break;
    //    }

    //}


    private void ModifySymble(DisplayText displayText, string text, TextDisplayStyleType StyleType)
    {
        if (StyleType == TextDisplayStyleType.Recover)
        {
            text = "+" + text;
        }
        else
        {
            text = "-" + text;
        }

        displayText.SetText(text);
    }
Example #4
0
 private void OnButtonPressedEvent(object sender, ButtonPressedEventArgs e)
 {
     try
     {
         _console.OutputEvent("OnButtonPressedEvent: " + e.Button);
         var displayText = new DisplayText();
         displayText.SetText(3, "B: " + e.Button, DisplayText.FontSize.Normal);
         e.Confirm(displayText, true);
     }
     catch (Exception exception)
     {
         _console.OutputError(exception);
     }
 }
Example #5
0
 private void OnScanEvent(object sender, ScanEventArgs e)
 {
     try
     {
         _console.OutputEvent("OnScanEvent: " + e.Data);
         var displayText = new DisplayText();
         displayText.SetText(2, "S: " + e.Data, DisplayText.FontSize.Normal);
         e.Confirm(displayText, true);
     }
     catch (Exception exception)
     {
         _console.OutputError(exception);
     }
 }
Example #6
0
    public void DisplayHitText(string hitText, int fontSize)
    {
        if (textNormalPrefab == null)
        {
            textNormalPrefab = Resources.Load <DisplayText>("HitEffect/HitText/HitTextNormal");
        }

        GameObject textObj = Instantiate(textNormalPrefab.gameObject);

        float   randomValue = 0.4f;
        float   randomX     = Random.Range(-randomValue, randomValue);
        float   randomY     = Random.Range(-randomValue, randomValue);
        float   randomZ     = Random.Range(-randomValue, randomValue);
        Vector3 randomPos   = new Vector3(randomX, randomY, randomZ) + (lookCameraTransform.up) + (vecToCamera.normalized * randomValue * 2);

        textObj.transform.position = displayer.transform.position + randomPos;
        DisplayText textComp = textObj.GetComponent <DisplayText>();

        textComp.SetText("<size=" + fontSize + ">" + hitText + "</size>");
    }
Example #7
0
        public override void Invoke(string[] param)
        {
            var row = QueryParam("Row", param, new Dictionary <int, string>
            {
                { 0, "0" },
                { 1, "1" },
                { 2, "2" },
                { 3, "3" },
                { 4, "4" },
                { 5, "5" },
            });

            var text = QueryParam <string>("Text", param);
            var font = QueryParam <DisplayText.FontSize>("Font", param);

            var dt = new DisplayText();

            dt.SetText(row, text, font);
            _text.WriteText(dt);
        }
Example #8
0
    private void _on_PhaseChanged(string newPhase, string oldPhase)
    {
        var directionDice = _diceManager.GetDirectionDice();

        switch (newPhase)
        {
        case nameof(GamePhase.GAME_START):
            _displayText.SetText("[center]Game START![/center]");
            _displayText.Display(nameof(GamePhase.GAME_START));
            break;

        case nameof(GamePhase.ZOMBIE_START):
            //directionDice.Position = new Vector2(1029.8f, 396.239f);
            directionDice.ShowDice();

            _displayText.SetText("[center]Zombie Player, Roll a Dice.[/center]");
            _displayText.Display();

            break;

        case nameof(GamePhase.PLAYERS_START):

            _displayText.SetText("[center]Human Player, Set your spawn location.[/center]");
            _displayText.Display();

            break;

        case nameof(GamePhase.ROUND_START):

            _roundNumber += 1;

            _displayText.SetText($"[center]Round {_roundNumber} Start![/center]");
            _displayText.Display(nameof(GamePhase.ROUND_START), 1000);

            SpawnQueue.HideWindow();
            _spawnPointManager.Hide();

            break;

        case nameof(GamePhase.HUMAN_PLAYER_START):

            var playerName = ((PlayerNumber)_currentPlayersTurn).ToString();
            _displayText.SetText($"[center]{playerName} Turn. Survive![/center]");
            _displayText.Display();

            _playerManager.StartPlayerUnitsTurn(_currentPlayersTurn);

            break;

        case nameof(GamePhase.ZOMBIE_PLAYER_START):

            _displayText.SetText($"[center]Z's Turn. Get them![/center]");
            _displayText.Display();

            _playerManager.StartPlayerUnitsTurn(_currentPlayersTurn);

            break;

        case nameof(GamePhase.ROUND_END):

            if (_playerManager.CanCreateAdditionalCharacter((int)PlayerNumber.Zombie))
            {
                _displayText.SetText($"Player Z, Let's add minions.");
                _displayText.Display();

                directionDice.ShowDice();
            }
            else
            {
                _displayText.SetText($"You are already strong enough Player Z, no more minions for you.");
                _displayText.Display(nameof(GamePhase.ROUND_START));
            }

            break;
        }
    }