Need a break from Dolphin
This commit is contained in:
@@ -24,10 +24,11 @@ textureGrid = textureLoad("minesweeper/grid_bg.dpi")
|
||||
|
||||
tilesetCell = tilesetGetByName("cell")
|
||||
textureCell = textureLoad(tilesetCell.texture)
|
||||
cellSliceHover = tilesetPositionGetUV(tilesetCell, 3, 4)
|
||||
cellSliceDefault = tilesetPositionGetUV(tilesetCell, 3, 5)
|
||||
cellSliceDown = tilesetPositionGetUV(tilesetCell, 3, 6)
|
||||
cellSliceDisabled = tilesetPositionGetUV(tilesetCell, 3, 7)
|
||||
-- cellSliceDefault = tilesetPositionGetUV(tilesetCell, 3, 5)
|
||||
cellSliceDefault = tilesetPositionGetUV(tilesetCell, 0, 4)
|
||||
-- cellSliceHover = tilesetPositionGetUV(tilesetCell, 3, 4)
|
||||
-- cellSliceDown = tilesetPositionGetUV(tilesetCell, 3, 6)
|
||||
-- cellSliceDisabled = tilesetPositionGetUV(tilesetCell, 3, 7)
|
||||
|
||||
width = 10
|
||||
height = 14
|
||||
@@ -42,15 +43,7 @@ for y = 1, height do
|
||||
end
|
||||
|
||||
function cellDraw(x, y, type)
|
||||
if type == CELL_STATE_HOVER then
|
||||
slice = cellSliceHover
|
||||
elseif type == CELL_STATE_DOWN then
|
||||
slice = cellSliceDown
|
||||
elseif type == CELL_STATE_DISABLED then
|
||||
slice = cellSliceDisabled
|
||||
else
|
||||
slice = cellSliceDefault
|
||||
end
|
||||
slice = cellSliceDefault
|
||||
|
||||
spriteBatchPush(textureCell,
|
||||
x, y,
|
||||
@@ -90,21 +83,22 @@ function sceneRender()
|
||||
cameraPushMatrix(camera)
|
||||
camera.bottom = screenGetHeight()
|
||||
camera.right = screenGetWidth()
|
||||
|
||||
cellDraw(0, 0, 0)
|
||||
|
||||
backgroundDraw()
|
||||
-- backgroundDraw()
|
||||
|
||||
offsetX = 32
|
||||
offsetY = 32
|
||||
for y = 0, height - 1 do
|
||||
for x = 0, width - 1 do
|
||||
cellDraw(
|
||||
x * tilesetCell.tileWidth + offsetX,
|
||||
y * tilesetCell.tileHeight + offsetY,
|
||||
cells[i]
|
||||
)
|
||||
break
|
||||
end
|
||||
end
|
||||
-- offsetX = 32
|
||||
-- offsetY = 32
|
||||
-- for y = 0, height - 1 do
|
||||
-- for x = 0, width - 1 do
|
||||
-- cellDraw(
|
||||
-- x * tilesetCell.tileWidth + offsetX,
|
||||
-- y * tilesetCell.tileHeight + offsetY,
|
||||
-- cells[i]
|
||||
-- )
|
||||
-- end
|
||||
-- end
|
||||
spriteBatchFlush()
|
||||
|
||||
cameraPopMatrix()
|
||||
|
||||
Reference in New Issue
Block a user