1234567891011121314151617181920212223242526272829303132 |
- --[[
- @module Sled:tileCmd
- ]]
- local Command = require "command"
- return Command("tile", {
- { "%", function (x, y)
- if not tonumber(x) or not tonumber(y) then return "bad input" end
- local x1, y1 = x or 1, y or 1
- local _x, _y = tonumber(x1)-1, tonumber(y1)-1
- local tx, ty = _x * Sled.tile_size, _y * Sled.tile_size
- Sled:tile(tx, ty):select()
- return string.format("x:%i y:%i selected", tx, ty)
- end
- },
- {
- "clear", function ()
- local tile = Sled.current_tile or Sled:tile(1, 1):select()
- tile:clear()
- end
- },
-
- {
- "flip", function (dir)
- local tile = Sled.current_tile or Sled:tile(1, 1):select()
- return tile:flip(dir)
- end
- },
- })
|