Example #1
0
                /// <summary>
                /// タイル設定を1段階動かします。
                /// </summary>
                public void Next(Map.TileDataType type, bool reverse)
                {
                    switch (type)
                    {
                    case Map.TileDataType.Hit:
                        this.Hit = (Map.HitType)Common.LoopNext((int)this.Hit, 0, Common.GetEnumCount <Map.HitType>(), reverse);
                        break;

                    case Map.TileDataType.InOut:
                        this.InOut = (Map.InOutType)Common.LoopNext((int)this.InOut, 0, Common.GetEnumCount <Map.InOutType>(), reverse);
                        break;

                    case Map.TileDataType.Priority:
                        this.Priority = (Map.TileDrawPriority)Common.LoopNext((int)this.Priority, 0, Common.GetEnumCount <Map.TileDrawPriority>(), reverse);
                        break;

                    case Map.TileDataType.GroupNumber:
                        this.GroupNumber = Common.LoopNext(this.GroupNumber, 0, TileData.GroupMax + 1, reverse);
                        break;
                    }
                    this.DataChanged?.Invoke(this, null);
                }
Example #2
0
            /// <summary>
            /// オートタイル/オブジェクトタイルに設定された各種情報を描画します。
            /// </summary>
            public void DrawTileData(Graphics g, Map.TileDataType editMode, Point pos, TileData tile)
            {
                const int OneCharOffset = -13;
                const int InOutOffset   = 1;
                const int FontStyleNum  = (int)FontStyle.Bold;
                //var font = new Font("MS ゴシック", 12.0f, FontStyle.Bold, GraphicsUnit.Point);
                var   font = new Font("MS ゴシック", 14.0f, FontStyle.Bold, GraphicsUnit.Point);
                var   buf  = "";
                SizeF mes;

                //縁取り準備
                var gp = new System.Drawing.Drawing2D.GraphicsPath();

                switch (editMode)
                {
                case Map.TileDataType.Hit:
                    buf = Map.GetTileHitTypeList()[(int)tile.Hit];
                    //g.DrawString(
                    gp.AddString(
                        buf,
                        font.FontFamily,
                        FontStyleNum,
                        font.Height,
                        new Point(
                            InOutOffset + pos.X + mgrDBTileset.TileSize / 2 + OneCharOffset,
                            InOutOffset + pos.Y + mgrDBTileset.TileSize / 2 + OneCharOffset * 2 / 3
                            ),
                        StringFormat.GenericTypographic
                        );
                    break;

                case Map.TileDataType.InOut:
                    if (tile.InOut.HasFlag(Map.InOutType.OKTop))
                    {
                        buf = "↑";
                    }
                    else
                    {
                        buf = "・";
                    }

                    mes = g.MeasureString(buf, font);
                    //g.DrawString(
                    gp.AddString(
                        buf,
                        font.FontFamily,
                        FontStyleNum,
                        font.Height,
                        new Point(
                            InOutOffset + pos.X + mgrDBTileset.TileSize / 2 - (int)(mes.Width / 2),
                            InOutOffset + pos.Y + 1
                            ),
                        StringFormat.GenericTypographic
                        );

                    if (tile.InOut.HasFlag(Map.InOutType.OKBottom))
                    {
                        buf = "↓";
                    }
                    else
                    {
                        buf = "・";
                    }

                    mes = g.MeasureString(buf, font);
                    //g.DrawString(
                    gp.AddString(
                        buf,
                        font.FontFamily,
                        FontStyleNum,
                        font.Height,
                        new Point(
                            InOutOffset + pos.X + mgrDBTileset.TileSize / 2 - (int)(mes.Width / 2),
                            InOutOffset + pos.Y + mgrDBTileset.TileSize - (int)mes.Height
                            ),
                        StringFormat.GenericTypographic
                        );

                    if (tile.InOut.HasFlag(Map.InOutType.OKRight))
                    {
                        buf = "→";
                    }
                    else
                    {
                        buf = "・";
                    }

                    mes = g.MeasureString(buf, font);
                    //g.DrawString(
                    gp.AddString(
                        buf,
                        font.FontFamily,
                        FontStyleNum,
                        font.Height,
                        new Point(
                            InOutOffset + pos.X + mgrDBTileset.TileSize - (int)mes.Width,
                            InOutOffset + pos.Y + mgrDBTileset.TileSize / 2 - (int)(mes.Height / 2)
                            ),
                        StringFormat.GenericTypographic
                        );

                    if (tile.InOut.HasFlag(Map.InOutType.OKLeft))
                    {
                        buf = "←";
                    }
                    else
                    {
                        buf = "・";
                    }

                    mes = g.MeasureString(buf, font);
                    //g.DrawString(
                    gp.AddString(
                        buf,
                        font.FontFamily,
                        FontStyleNum,
                        font.Height,
                        new Point(
                            InOutOffset + pos.X + 1,
                            InOutOffset + pos.Y + mgrDBTileset.TileSize / 2 - (int)(mes.Height / 2)
                            ),
                        StringFormat.GenericTypographic
                        );
                    break;

                case Map.TileDataType.Priority:
                    buf = Map.GetTileDrawPriorityList()[(int)tile.Priority];
                    //g.DrawString(
                    gp.AddString(
                        buf,
                        font.FontFamily,
                        FontStyleNum,
                        font.Height,
                        new Point(
                            pos.X + mgrDBTileset.TileSize / 2 + OneCharOffset,
                            pos.Y + mgrDBTileset.TileSize / 2 + OneCharOffset * 2 / 3
                            ),
                        StringFormat.GenericTypographic
                        );
                    break;

                case Map.TileDataType.GroupNumber:
                    //g.DrawString(
                    gp.AddString(
                        $"{tile.GroupNumber,2}",
                        font.FontFamily,
                        FontStyleNum,
                        font.Height,
                        new Point(
                            pos.X + mgrDBTileset.TileSize / 2 + OneCharOffset,
                            pos.Y + mgrDBTileset.TileSize / 2 + OneCharOffset * 2 / 3
                            ),
                        StringFormat.GenericTypographic
                        );
                    break;
                }

                //縁取り実行
                //g.DrawPath(new Pen(Color.Black, 2.0f), gp);
                g.DrawPath(new Pen(Color.Black, 3.0f), gp);
                g.FillPath(Brushes.White, gp);
            }