예제 #1
0
    protected override IEnumerable <ICoroutine> Loading()
    {
        ICoroutine async;
        ICoroutine ___async;

        TB190712145935.Texture = PATCH.GetNinePatch(PATCH.NullColor, new COLOR(192, 192, 192, 255), 2);



        TBResult.SourceNormal = PATCH.GetNinePatch(PATCH.NullColor, new COLOR(0, 0, 0, 255), 1);


        BSave.SourceNormal = PATCH.GetNinePatch(PATCH.NullColor, new COLOR(0, 0, 0, 255), 2);



        DDAction.SourceNormal = PATCH.GetNinePatch(PATCH.NullColor, new COLOR(255, 255, 0, 255), 2);


        var __loading = MyLoading();

        if (__loading != null)
        {
            foreach (var item in __loading)
            {
                yield return(item);
            }
        }
    }
예제 #2
0
    private EntryEngine.UI.CheckBox ___CBTypes()
    {
        var CBTypes = new EntryEngine.UI.CheckBox();

        CBTypes.Name = "  CBTypes";
        EntryEngine.RECT CBTypes_Clip = new EntryEngine.RECT();
        CBTypes_Clip.X      = 2f;
        CBTypes_Clip.Y      = 2f;
        CBTypes_Clip.Width  = 80f;
        CBTypes_Clip.Height = 24f;
        CBTypes.Clip        = CBTypes_Clip;

        CBTypes.SourceClicked    = PATCH.GetNinePatch(PATCH.NullColor, new COLOR(0, 0, 0, 255), 1);
        CBTypes.UIText           = new EntryEngine.UI.UIText();
        CBTypes.UIText.Text      = "分类分类分类";
        CBTypes.UIText.FontColor = new COLOR()
        {
            B = 51,
            G = 51,
            R = 51,
            A = 255,
        };
        CBTypes.UIText.TextAlignment = (EPivot)17;
        CBTypes.UIText.TextShader    = null;
        CBTypes.UIText.Padding.X     = 0f;
        CBTypes.UIText.Padding.Y     = 0f;
        CBTypes.UIText.FontSize      = 12f;

        CBTypes.Text                 = "分类分类分类";
        CBTypes.IsRadioButton        = true;
        CBTypes.CheckedOverlayNormal = true;

        return(CBTypes);
    }
예제 #3
0
    protected override IEnumerable <ICoroutine> Loading()
    {
        ICoroutine async;
        ICoroutine ___async;

        TB190718101113.Texture = PATCH.GetNinePatch(PATCH.NullColor, new COLOR(0, 0, 0, 255), 1);

        CBTypes.SourceClicked = PATCH.GetNinePatch(PATCH.NullColor, new COLOR(0, 0, 0, 255), 1);

        TBThumnail.Texture = PATCH.GetNinePatch(PATCH.NullColor, new COLOR(153, 153, 153, 255), 1);


        var __loading = MyLoading();

        if (__loading != null)
        {
            foreach (var item in __loading)
            {
                yield return(item);
            }
        }
    }
예제 #4
0
    protected override IEnumerable <ICoroutine> Loading()
    {
        // 你可以自定义你的第一个初始菜单来替换MAIN

        AsyncReadFile async;

        // 你还可以加载其它一些常量表

        //async = _IO.ReadAsync("Tables\\CC.xml");
        //if (!async.IsEnd) yield return async;
        //_CC.Load(_IO.ReadPreambleText(async.Data));
        //_LOG.Debug("加载客户端常量表完毕");

        //async = _IO.ReadAsync("Tables\\C.xml");
        //if (!async.IsEnd) yield return async;
        //_C.Load(_IO.ReadPreambleText(async.Data));
        //_LOG.Debug("加载常量表完毕");

        Encoding encoding = _IO.IOEncoding;

        _IO.IOEncoding = Encoding.Default;

        //async = _IO.ReadAsync("Tables\\LANGUAGE.csv");
        //if (!async.IsEnd) yield return async;
        //_LANGUAGE.Load(_IO.ReadPreambleText(async.Data), "");
        //_LOG.Debug("加载语言表完毕");

        async = _IO.ReadAsync("Metadata.pcsv");
        if (!async.IsEnd)
        {
            yield return(async);
        }
        PipelinePiece.GetDefaultPipeline().LoadMetadata(_IO.ReadPreambleText(async.Data));
        _LOG.Debug("加载纹理集表完毕");

        foreach (var item in _TABLE.LoadAsync("Tables\\"))
        {
            if (!item.IsEnd)
            {
                yield return(item);
            }
        }
        _LOG.Debug("加载数据表完毕");

        _IO.IOEncoding = encoding;

        // 确保加载完了所有的基本资源后就可以启动第一个正式的菜单了
        //Entry.ShowMainScene<T>();
        //this.State = EState.Release;

        Content     = Entry.NewContentManager();
        tileTexture = PATCH.GetNinePatch(new COLOR(255, 0, 0, 32), new COLOR(255, 0, 0, 196), 1);

        RECT rect = new RECT(0, 600, 100, 30);

        tile = new RECT[200];
        for (int i = 0; i < tile.Length; i++)
        {
            tile[i] = rect;
            rect.X += rect.Width;
            if (i == 6)
            {
                rect.Y -= 60;
            }
            if (i > 7)
            {
                rect.Y    -= 9;
                rect.Width = 10;
            }
            mapWidth += rect.Width;
        }
        tile[tile.Length - 1] = new RECT(200, 400, 30, 120);

        charaTexture = PATCH.GetNinePatch(new COLOR(0, 255, 0, 32), new COLOR(0, 255, 0, 196), 1);
        chara        = new RECT(200, 150, 50, 50);

        Entry.INPUT.Keyboard.AddMultipleClick((int)PCKeys.A, (int)PCKeys.D);

        anime = Content.Load <ANIMATION>("Actions\\蒲公英.mtseq");

        yield break;
    }
예제 #5
0
 private IEnumerable <ICoroutine> MyLoading()
 {
     area = PATCH.GetNinePatch(new COLOR(255, 0, 0, 64), new COLOR(255, 0, 0, 222), 1);
     ResetViewport();
     return(null);
 }
예제 #6
0
    private IEnumerable <ICoroutine> MyLoading()
    {
        NewMap();

        _TABLE.SetPath("Tables/");
        foreach (var item in _TABLE.LoadT地形Async())
        {
            yield return(item);
        }

        ResetViewport();
        // 预设地形分类
        Dictionary <string, List <T地形> > dics = new Dictionary <string, List <T地形> >();

        foreach (var item in _TABLE._T地形)
        {
            string key;
            if (string.IsNullOrEmpty(item.Texture))
            {
                key = "碰撞区域";
            }
            else
            {
                key = item.Texture.Split('\\')[1];
            }

            List <T地形> list;
            if (!dics.TryGetValue(key, out list))
            {
                list = new List <T地形>();
                dics.Add(key, list);
            }

            list.Add(item);
        }
        // 加载预设
        foreach (var type in dics)
        {
            var cb = ___CBTypes();
            cb.Name       = type.Key;
            cb.Text       = type.Key;
            cb.X          = PTypes.ChildCount * cb.Width + 5;
            cb.OnChecked += (sender1, e1) =>
            {
                PPre.Clear();

                List <T地形> list = dics[sender1.Name];
                for (int i = 0; i < list.Count; i++)
                {
                    var item = list[i];

                    TextureBox container = new TextureBox();
                    container.Width       = 100;
                    container.Height      = 100;
                    container.X           = 10 + (i % 5) * (container.Width + 5);
                    container.Y           = 5 + (i / 5) * (container.Height + 5);
                    container.DisplayMode = EViewport.Strength;
                    container.Texture     = PATCH.GetNinePatch(COLOR.TransparentBlack, COLOR.Black, 1);

                    TextureBox tb = new TextureBox();
                    tb.Tag         = item;
                    tb.Width       = container.Width;
                    tb.Height      = container.Height;
                    tb.DisplayMode = EViewport.Adapt;
                    tb.Flip        = item.Flip;
                    if (string.IsNullOrEmpty(item.Texture))
                    {
                        // 没有图像时绘制碰撞区域
                        tb.DrawAfterEnd = (sender, sb, e) =>
                        {
                            float   scale;
                            VECTOR2 offset;
                            __GRAPHICS.ViewAdapt(item.BoundingBox.Size, tb.Size, out scale, out offset);
                            RECT view = sender.ViewClip;
                            //foreach (var area in item._Hit)
                            //{
                            //    sb.Draw(TEXTURE.Pixel,
                            //        new RECT(view.X + offset.X + (area.X - item.BoundingBox.X) * scale,
                            //            view.Y + offset.Y + (area.Y - item.BoundingBox.Y) * scale,
                            //            area.Width * scale, area.Height * scale),
                            //        new COLOR(255, 0, 0, 128));
                            //}
                            item.DrawHitArea(view.X + offset.X, view.Y + offset.Y, scale);
                        };
                    }
                    else
                    {
                        tb.Texture = Content.Load <TEXTURE>(item.Texture);
                    }
                    tb.Clicked += (sender, e) =>
                    {
                        // 单击选中地形
                        painting.ID      = item.ID;
                        painting.Data    = item;
                        painting.Texture = tb.Texture;
                    };

                    container.Add(tb);
                    PPre.Add(container);
                }
            };
            PTypes.Add(cb);
        }
        ((CheckBox)PTypes[0]).DoCheck();

        font = new UIText();
        //font.FontSize = 12;
        font.FontColor  = COLOR.White;
        font.TextShader = new TextShader()
        {
            Color = COLOR.Silver,
        };
        font.TextAlignment = EPivot.BottomLeft;
    }