Ejemplo n.º 1
0
        public WndCatalogus()
        {
            Resize(WIDTH, HEIGHT);

            _txtTitle = PixelScene.CreateText(TxtTitle, 9);
            _txtTitle.Hardlight(TitleColor);
            _txtTitle.Measure();
            Add(_txtTitle);

            _list             = new ScrollPane(new Component());
            _list.ClickAction = ListClick;
            Add(_list);
            _list.SetRect(0, _txtTitle.Height, WIDTH, HEIGHT - _txtTitle.Height);

            var potionTab = new LabeledTab(this, TxtPotions);

            potionTab.SelectAction = PotionTabSelect;
            Tabs.Add(potionTab);

            var scrollTab = new LabeledTab(this, TxtPotions);

            scrollTab.SelectAction = ScrollTabSelect;
            Tabs.Add(potionTab);

            foreach (var tab in Tabs)
            {
                tab.SetSize(TabWidth, TabHeight());
                Add(tab);
            }

            Select(ShowPotions ? 0 : 1);
        }
        public CreditsWidget()
        {
            _tween  = new TweenSequence(() => IsFinished = true);
            _header = new BitmapText(Gfx.BitmapFontOutline, "<header>");
            _body   = new BitmapText(Gfx.BitmapFontOutline, "<body>");

            _header.FontScale = 0.75f;
            _body.FontScale   = 0.5f;

            _header.Width = S.ViewportWidth;
            _body.Width   = S.ViewportWidth;

            _body.Height  = _body.EffectiveLineHeight * 3;
            _header.Alpha = 0;
            _body.Alpha   = 0;
            _header.X     = Padding;
            _header.Y     = Padding;
            _body.X       = Padding;
            _body.Y       = _header.Y + _header.Height * _header.FontScale;

            AddCredit("A game by", "Evidently Cube");
            AddCredit("Graphics:", "Aleksander Kowalczyk");
            AddCredit("Music:", "Jakub \"AceMan\" Szelag\n\"The Eldest Tribe\"");
            AddCredit("Voice over:", "Alex Diener");
            AddCredit("Sound effects:", "freesfx.co.uk\nhttp://freesound.org");
            AddCredit("Story, programming, levels, game design:", "Maurycy Zarzycki");
            AddCredit("Machine at the Heart of the World", "Made for MonoGameJam 2018");
        }
Ejemplo n.º 3
0
        public WndJournal()
        {
            Resize(WIDTH, HEIGHT);

            txtTitle = PixelScene.CreateText(TxtTitle, 9);
            txtTitle.Hardlight(TitleColor);
            txtTitle.Measure();
            txtTitle.X = PixelScene.Align(PixelScene.uiCamera, (WIDTH - txtTitle.Width) / 2);
            Add(txtTitle);

            var content = new Component();

            Collections.Sort(Journal.Records);

            float pos = 0;

            foreach (var rec in Journal.Records)
            {
                var item = new ListItem(rec.feature, rec.depth);
                item.SetRect(0, pos, WIDTH, ItemHeight);
                content.Add(item);

                pos += item.Height;
            }

            content.SetSize(WIDTH, pos);

            list = new ScrollPane(content);
            Add(list);

            list.SetRect(0, txtTitle.Height, WIDTH, HEIGHT - txtTitle.Height);
        }
Ejemplo n.º 4
0
        private void dispActionCount(int count)
        {
            if (!this.mIsInitialized)
            {
                return;
            }
            if (count < 0)
            {
                count = 0;
            }
            this.GoWhiteFont.SetActive(false);
            this.GoYellowFont.SetActive(false);
            this.GoRedFont.SetActive(false);
            GameObject gameObject = this.GoWhiteFont;

            if ((long)count <= 5L)
            {
                gameObject = this.GoRedFont;
            }
            else if ((long)count <= 20L)
            {
                gameObject = this.GoYellowFont;
            }
            gameObject.SetActive(true);
            BitmapText componentInChildren = (BitmapText)gameObject.GetComponentInChildren <BitmapText>(true);

            if (!Object.op_Implicit((Object)componentInChildren))
            {
                return;
            }
            componentInChildren.text = count.ToString();
        }
Ejemplo n.º 5
0
        protected override void CreateChildren()
        {
            base.CreateChildren();

            _secondary = PixelScene.CreateText(6);
            _secondary.Hardlight(SecondaryColor);
            Add(_secondary);
        }
Ejemplo n.º 6
0
        protected override void CreateChildren()
        {
            _sprite = new ItemSprite();
            Add(_sprite);

            _label = PixelScene.CreateText(8);
            Add(_label);
        }
Ejemplo n.º 7
0
        protected override void CreateChildren()
        {
            _tf = new BitmapText(PixelScene.font1x);
            _tf.Hardlight(0xFFFF00);
            Add(_tf);

            Visible = false;
        }
Ejemplo n.º 8
0
            protected override void CreateChildren()
            {
                base.CreateChildren();

                _btLabel = PixelScene.CreateText(9);

                Add(_btLabel);
            }
Ejemplo n.º 9
0
    public BitmapTextWrapProcessor(BitmapText _BitmapText) : base(_BitmapText)
    {
        m_Lines     = new List <BitmapLine>();
        m_LineGroup = new List <BitmapLine>();
        m_Line      = new List <BitmapCharacter>();

        m_PositionProcessor = new BitmapTextPositionProcessor(BitmapText, BitmapTextPositionProcessor.Direction.Horizontal);
    }
Ejemplo n.º 10
0
            protected override void CreateChildren()
            {
                _icon = new Image();
                Add(_icon);

                _label = PixelScene.CreateText(6);
                Add(_label);
            }
 public IntroScene()
 {
     _text                 = new BitmapText(Gfx.BitmapFontOutline, new SizeF(S.ViewportWidth, 400));
     _text.FontScale       = 0.75f;
     _text.HorizontalAlign = BitmapTextHorizontalAlign.Center;
     _text.VerticalAlign   = BitmapTextVerticalAlign.Middle;
     _text.Position        = new PointF(0, S.ViewportHeight - _text.Height);
     _text.Width          -= 40;
     _text.X              += 20;
 }
Ejemplo n.º 12
0
            protected override void CreateChildren()
            {
                base.CreateChildren();

                _image = new Image(Assets.DASHBOARD);
                Add(_image);

                _label = CreateText(9);
                Add(_label);
            }
Ejemplo n.º 13
0
        public static BitmapText CreateText(string text, float size)
        {
            ChooseFont(size);

            var result = new BitmapText(text, font);

            result.Scale.Set(scale);

            return(result);
        }
Ejemplo n.º 14
0
        protected override void CreateChildren()
        {
            base.CreateChildren();

            Bg = Chrome.Get(Chrome.Type.BUTTON);
            Add(Bg);

            InternalText = PixelScene.CreateText(9);
            Add(InternalText);
        }
Ejemplo n.º 15
0
        protected override void CreateChildren()
        {
            base.CreateChildren();

            number = new BitmapText(PixelScene.font1x);
            Add(number);

            icon = Icons.SKULL.Get();
            Add(icon);
        }
Ejemplo n.º 16
0
        public override void Draw()
        {
            base.Draw();
            var p = Camera.ScreenToCamera((int)X, (int)Y).Offset(Point().Negate()).InvScale(Size).Floor();

            var txt = new BitmapText(p.X + "," + p.Y, PixelScene.font25x);

            txt.X = X;
            txt.Y = Y;
            txt.Draw();
        }
Ejemplo n.º 17
0
            protected override void CreateChildren()
            {
                _feature = PixelScene.CreateText(9);
                Add(_feature);

                _depth = new BitmapText(PixelScene.font1x);
                Add(_depth);

                _icon = Icons.DEPTH.Get();
                Add(_icon);
            }
Ejemplo n.º 18
0
    public BitmapTextShakeAnimation(BitmapText _BitmapText, TagText.Node _Node) : base(_BitmapText, _Node)
    {
        m_Speed     = _Node.GetFloat("speed", 1);
        m_Size      = _Node.GetFloat("size", 200);
        m_Amplitude = _Node.GetFloat("amplitude", 2);

        m_Directions = new Vector2[DIRECTIONS_LENGTH];
        for (int i = 0; i < m_Directions.Length; i++)
        {
            m_Directions[i] = Random.insideUnitCircle;
        }
    }
Ejemplo n.º 19
0
            protected override void CreateChildren()
            {
                _bg = new ColorBlock(HEIGHT, HEIGHT, Color.Argb(0xFF, 0x4A, 0x4D, 0x44));
                Add(_bg);

                _slot = new ItemSlot();
                Add(_slot);

                _name = PixelScene.CreateText("?", 7);
                Add(_name);

                base.CreateChildren();
            }
Ejemplo n.º 20
0
        protected override void CreateChildren()
        {
            base.CreateChildren();

            _avatar = new Image(Assets.AVATARS);
            Add(_avatar);

            _name = PixelScene.CreateText(9);
            Add(_name);

            _emitter = new Emitter();
            Add(_emitter);
        }
Ejemplo n.º 21
0
        protected override void CreateChildren()
        {
            base.CreateChildren();

            Bg = Chrome.Get(Chrome.Type.TOAST_TR);
            Add(Bg);

            Close             = new SimpleButton(Icons.CLOSE.Get());
            Close.ClickAction = OnClose;
            Add(Close);

            BitmapText = PixelScene.CreateText(8);
            Add(BitmapText);
        }
        public PauseView()
        {
            _header          = new BitmapText(Gfx.BitmapFont, "Machine at the Heart of the World");
            _resume          = new BitmapText(Gfx.BitmapFont, "Resume");
            _musicVolume     = new BitmapText(Gfx.BitmapFont, "Music volume: " + Math.Round(Save.MusicVolume * 10));
            _sfxVolume       = new BitmapText(Gfx.BitmapFont, "Sound effects volume: " + Math.Round(Save.SoundVolume * 10));
            _voiceOverVolume = new BitmapText(Gfx.BitmapFont,
                                              "Voice over volume: " + Math.Round(Save.VoiceOverVolume * 10));
            _quit = new BitmapText(Gfx.BitmapFont, "Quit");

            _resume.FontScale          = 0.5f;
            _musicVolume.FontScale     = 0.5f;
            _sfxVolume.FontScale       = 0.5f;
            _voiceOverVolume.FontScale = 0.5f;
            _quit.FontScale            = 0.5f;

            _header.Width          = S.ViewportWidth;
            _resume.Width          = S.ViewportWidth;
            _musicVolume.Width     = S.ViewportWidth;
            _sfxVolume.Width       = S.ViewportWidth;
            _voiceOverVolume.Width = S.ViewportWidth;
            _quit.Width            = S.ViewportWidth;

            _header.HorizontalAlign          = BitmapTextHorizontalAlign.Center;
            _resume.HorizontalAlign          = BitmapTextHorizontalAlign.Center;
            _musicVolume.HorizontalAlign     = BitmapTextHorizontalAlign.Center;
            _sfxVolume.HorizontalAlign       = BitmapTextHorizontalAlign.Center;
            _voiceOverVolume.HorizontalAlign = BitmapTextHorizontalAlign.Center;
            _quit.HorizontalAlign            = BitmapTextHorizontalAlign.Center;

            _header.Y          = 200;
            _resume.Y          = _header.Y + _header.Height + 100;
            _musicVolume.Y     = _resume.Y + _resume.Height;
            _sfxVolume.Y       = _musicVolume.Y + _musicVolume.Height;
            _voiceOverVolume.Y = _sfxVolume.Y + _sfxVolume.Height;
            _quit.Y            = _voiceOverVolume.Y + _voiceOverVolume.Height;

            _options = new List <BitmapText> {
                _resume,
                _musicVolume,
                _sfxVolume,
                _voiceOverVolume,
                _quit
            };
            _selectedOption = _resume;

            _options.ForEach(x => x.Alpha = 0.5f);
            _selectedOption.Alpha         = 1;
        }
Ejemplo n.º 23
0
        private void CreateGoldObjects(Transform parent)
        {
            if (this.mCurrentQuest != null && !this.mCurrentQuest.IsVersus)
            {
                return;
            }
            if ((int)this.mResultData.Record.gold <= 0)
            {
                return;
            }
            GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.TreasureListItem);

            gameObject.get_transform().SetParent(parent, false);
            this.mTreasureListItems.Add(gameObject);
            gameObject.SetActive(true);
            Transform child1 = gameObject.get_transform().FindChild("BODY/frame");

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)child1, (UnityEngine.Object)null))
            {
                Image_Transparent component = (Image_Transparent)((Component)child1).GetComponent <Image_Transparent>();
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.GoldFrame, (UnityEngine.Object)null))
                {
                    component.set_sprite(this.GoldFrame);
                }
            }
            Transform child2 = gameObject.get_transform().FindChild("BODY/itemicon");

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)child2, (UnityEngine.Object)null))
            {
                RawImage_Transparent component = (RawImage_Transparent)((Component)child2).GetComponent <RawImage_Transparent>();
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.GoldTex, (UnityEngine.Object)null))
                {
                    component.set_texture((Texture)this.GoldTex);
                }
            }
            Transform child3 = gameObject.get_transform().FindChild("BODY/amount/Text_amount");

            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)child3, (UnityEngine.Object)null))
            {
                return;
            }
            BitmapText component1 = (BitmapText)((Component)child3).GetComponent <BitmapText>();

            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)component1, (UnityEngine.Object)null))
            {
                return;
            }
            component1.text = this.mResultData.Record.gold.ToString();
        }
Ejemplo n.º 24
0
        public SubtitleWidget()
        {
            _tween = new TweenSequence();
            _body  = new BitmapText(Gfx.BitmapFontOutline);

            _body.FontScale       = 0.75f;
            _body.HorizontalAlign = BitmapTextHorizontalAlign.Center;
            _body.VerticalAlign   = BitmapTextVerticalAlign.Middle;

            _body.Width  = S.ViewportWidth - ControlsWidget.Padding * 4 - ControlsWidget.TextureWidth * 2;
            _body.Height = _body.EffectiveLineHeight * _body.FontScale * 3.4f;

            _body.X = ControlsWidget.Padding * 2 + ControlsWidget.TextureWidth;
            _body.Y = S.ViewportHeight - _body.Height;
        }
Ejemplo n.º 25
0
        protected override void CreateChildren()
        {
            base.CreateChildren();

            Icon = new ItemSprite();
            Add(Icon);

            TopLeft = new BitmapText(PixelScene.font1x);
            Add(TopLeft);

            TopRight = new BitmapText(PixelScene.font1x);
            Add(TopRight);

            BottomRight = new BitmapText(PixelScene.font1x);
            Add(BottomRight);
        }
Ejemplo n.º 26
0
            protected override void CreateChildren()
            {
                base.CreateChildren();

                _shield = new ItemSprite(ItemSpriteSheet.TOMB, null);
                Add(_shield);

                _position = new BitmapText(font1x);
                Add(_position);

                _desc = CreateMultiline(9);
                Add(_desc);

                _classIcon = new Image();
                Add(_classIcon);
            }
Ejemplo n.º 27
0
        public override void Create()
        {
            base.Create();

            string text = "";

            switch (mode)
            {
            case Mode.DESCEND:
                text = TXT_DESCENDING;
                break;

            case Mode.ASCEND:
                text = TXT_ASCENDING;
                break;

            case Mode.CONTINUE:
                text = TXT_LOADING;
                break;

            case Mode.RESURRECT:
                text = TXT_RESURRECTING;
                break;

            case Mode.RETURN:
                text = TXT_RETURNING;
                break;

            case Mode.FALL:
                text = TXT_FALLING;
                break;
            }

            message = CreateText(text, 9);
            message.Measure();
            message.X = (Camera.Main.CameraWidth - message.Width) / 2;
            message.Y = (Camera.Main.CameraHeight - message.Height) / 2;
            Add(message);

            phase    = Phase.FADE_IN;
            timeLeft = TIME_TO_FADE;
            Run();

            //thread = new Thread(Run);
            //thread.Start();
        }
Ejemplo n.º 28
0
    public BitmapTextAnimation(BitmapText _BitmapText, TagText.Node _Node)
    {
        m_BitmapText = _BitmapText;
        m_Characters = new List <BitmapCharacter>();

        if (_Node == null)
        {
            return;
        }

        int sourceIndex = _Node.Index;
        int targetIndex = _Node.Index + _Node.Length;

        foreach (BitmapCharacter character in m_BitmapText.Characters)
        {
            if (character.Enabled && character.Visible && character.Index >= sourceIndex && character.Index <= targetIndex)
            {
                m_Characters.Add(character);
            }
        }
    }
Ejemplo n.º 29
0
            public MobTitle(Mob mob)
            {
                _hp = (float)mob.HP / mob.HT;

                _name = PixelScene.CreateText(Utils.Capitalize(mob.Name), 9);
                _name.Hardlight(TitleColor);
                _name.Measure();
                Add(_name);

                _image = mob.Sprite;
                Add(_image);

                _hpBg = new ColorBlock(1, 1, _colorBg);
                Add(_hpBg);

                _hpLvl = new ColorBlock(1, 1, _colorLvl);
                Add(_hpLvl);

                _buffs = new BuffIndicator(mob);
                Add(_buffs);
            }
    public BitmapTextRainbowAnimation(BitmapText _BitmapText, TagText.Node _Node) : base(_BitmapText, _Node)
    {
        const float step = 1.0f / 7.0f;

        m_Speed              = _Node.GetFloat("speed", 1);
        m_Gradient           = new Gradient();
        m_Gradient.alphaKeys = new GradientAlphaKey[]
        {
            new GradientAlphaKey(1, 0),
            new GradientAlphaKey(1, 1),
        };
        m_Gradient.colorKeys = new GradientColorKey[]
        {
            new GradientColorKey(new Color(1.0f, 0.0f, 0.0f), step * 0),
            new GradientColorKey(new Color(1.0f, 0.5f, 0.0f), step * 1),
            new GradientColorKey(new Color(1.0f, 1.0f, 0.0f), step * 2),
            new GradientColorKey(new Color(0.0f, 1.0f, 0.0f), step * 3),
            new GradientColorKey(new Color(0.0f, 0.5f, 1.0f), step * 4),
            new GradientColorKey(new Color(0.0f, 0.0f, 1.0f), step * 5),
            new GradientColorKey(new Color(1.0f, 0.0f, 1.0f), step * 6),
            new GradientColorKey(new Color(1.0f, 0.0f, 0.0f), step * 7),
        };
    }