| 赞 | 0 |
| VIP | |
| 好人卡 | |
| 积分 | 1 |
| 经验 | |
| 最后登录 | 2013-10-13 |
| 在线时间 | 142 小时 |
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 142 小时
- 注册时间
- 2013-4-13
- 回帖
- 82
|
楼主 |
发表于 2013-5-17 14:58:17
|
显示全部楼层
我看xp绘制地图的时候,用到tile_id,不知道这个数值
xp是怎么导出数据的。 并且怎么用。
[pre lang="ruby" line="1"] for z in 0...@map_data.zsize
723. # Passes Through X Coordinates
724. for x in x1...x2
725. # Passes Through Y Coordinates
726. for y in y1...y2
727. # Collects Tile ID
728. id = @map_data[x, y, z]
729. # Skip if 0 tile
730. next if id == 0
731. # Skip If Non-Animated Tile
732. next unless @autotiles[id / 48 - 1].width / 96 > 1 if id < 384
733. # Passes Through All Priorities
734. for p in 0..5
735. # Skip If Priority Doesn't Match
736. next unless p == @priorities[id]
737. # Cap Priority to Layer 3
738. p = 2 if p > 2
739. # If Autotile
740. if id < 384
741. # Draw Auto-Tile
742. draw_autotile(x, y, p, id)
743. # Draw Higher Tiles
744. for l in 0...@map_data.zsize
745. id_l = @map_data[x, y, l]
746. draw_tile(x, y, p, id_l)
747. end
748. # Save Autotile Location
749. autotile_locations[x, y, z] = 1
750. # If Normal Tile
751. else
752. # If Autotile Drawn
753. if autotile_locations[x, y, z] == 1
754. # Redraw Normal Tile
755. draw_tile(x, y, p, id)
756. # Draw Higher Tiles
757. for l in 0...@map_data.zsize
758. id_l = @map_data[x, y, l]
759. draw_tile(x, y, p, id_l)
760. end
761. end
762. end
763. end
764. end
765. end
766. end
767. end
[/pre]
上面有tile_id的使用, 没搞清楚跟啥有关系, 这个384,是什么概念?
望清楚的可以给小弟明示一下。 谢谢啦。 |
|