Beispiel #1
0
        private void OpenAreaSelection()
        {
            currentScreen = 1;
            //If the player is entering the map he already is in, start hovering in his current area, rather than the 'area 0' of that map.
            displayArea = (displayMap == originalMap) ? OriginalAreaIndexInCurrentMap : 0;

            if (currentAreaMarker != null)
            {
                currentAreaMarker.SetActive(false);
            }

            //The marker that indicates the area that is being chosen.
            hoveredMarker = ScreenElement.BuildRectangle("OptionMarker", screenDisplay.transform).SetSize(2, 2).SetFlickPeriod(0.25f)
                            .SetPosition(thisWorldData.areas[SelectedArea].coords);
            hoveredAreaName = ScreenElement.BuildTextBox("AreaName", screenDisplay.transform, DFont.Small).SetText("area").SetPosition(28, 5);

            if (displayMap == 0 || displayMap == 3)
            {
                hoveredAreaName.SetPosition(2, 1);
            }
            else
            {
                hoveredAreaName.SetPosition(2, 26);
            }

            hoveredAreaName.Text = string.Format("area{0:00}", SelectedArea + 1); //+1 because, in game, areas start at #1, not 0.
        }
Beispiel #2
0
        private IEnumerator AnimateName(TextBoxBuilder builder)
        {
            yield return(null); //Wait for the next frame so the builder's text fitter has adjusted the component's Width.

            int goWidth = builder.Width;

            while (true)
            {
                builder.SetPosition(32, 0);
                for (int i = 0; i < goWidth + 32; i++)
                {
                    builder.Move(Direction.Left);
                    yield return(new WaitForSeconds(0.1f));
                }
                yield return(new WaitForSeconds(1.5f));
            }
        }