コロナSDKにタイル張りされたアイソメトリックマップをインポートし、グリッドレイヤをオーバーレイしようとしています。私はアイソメトリックグリッドを多読しましたが、それらはすべて、高さが幅の半分であるタイルセットを参照しているようです。 (例:128x64px)。私は256x149pxのグリッドを必要とするタイルセットを使用していますが、私はその変更に対応するためにグリッド生成関数を編集する必要があると思います。どんな助けでも大歓迎です! (オリジナルのベクトルを用いた)問題のコロナSDKのタイルセットのアイソメトリックグリッドの生成
スクリーンショット:
Original Vectors:https://image.ibb.co/emXpQR/Screen_Shot_2017_12_18_at_1_35_19_PM.png
Edited Vectors (the ones commented out in code):https://image.ibb.co/ikxOkR/Screen_Shot_2017_12_18_at_1_35_54_PM.png
グリッド生成コード:あなたはスクリーンショットのタイルで見ることができるように
function drawGrid()
for row = 0, 16 do
local gridRow = {}
for col = 0, 9 do
-- draw a diamond shaped tile
local vertices = { 0,-16, -64,16, 0,48, 64,16 }
-- MY EDITED VERTICES { 0,-37.25, -128,37.25, 0,111.75, 128,37.25 }
local tile = display.newPolygon(group, 0, 0, vertices)
-- outline the tile and make it transparent
tile.strokeWidth = 1
tile:setStrokeColor(0, 1, 1)
tile.alpha = .4
local tileWidth = 256
local tileHeight = 149
-- set the tile's x and y coordinates
local x = col * tileHeight
local y = row * tileHeight
tile.x = (x - y)
tile.y = ((tileHeight/2) + ((x + y)/2))
-- make a tile walkable
gridRow[col] = 0
end
-- add gridRow table to the map table
j_map[row] = gridRow
end
end
地図の横にあるようなもの。誰かがそれを修正する方法を知っているか、情報に関するより多くの情報が必要な場合は、私に知らせてください!
コロナSDKのアイソメトリックマップのレンダリングにはどうしますか? – ldurniat