Annotations changes: clarification of types, addition of missing annotations
This commit is contained in:
@@ -1,20 +1,23 @@
|
||||
---@class TileSheet
|
||||
---@field image string Name of texture
|
||||
---@field width number Number of tiles in the table horizontally
|
||||
---@field height number Number of tiles in the table vertically
|
||||
---@field height number Number of tiles in the table vertically
|
||||
local TileSheet = {}
|
||||
|
||||
---@param image string Name of texture
|
||||
---@param width number Number of tiles in the table horizontally
|
||||
---@param height number Number of tiles in the table vertically
|
||||
---@param height number Number of tiles in the table vertically
|
||||
---@return TileSheet
|
||||
function TileSheet:new(image, width, height)
|
||||
---@type TileSheet
|
||||
local instance = setmetatable({
|
||||
image = image,
|
||||
width = width,
|
||||
height = height,
|
||||
}, {__index = self})
|
||||
|
||||
-- TODO возможно будет лучше сделать автоматическое определение высоты и ширины по разрешению текстуры
|
||||
|
||||
return instance
|
||||
end
|
||||
|
||||
@@ -28,7 +31,7 @@ function TileSheet:getTextureName(x, y)
|
||||
return textureName
|
||||
end
|
||||
|
||||
---Aleas for `TileSheet:getTextureName`.
|
||||
---Alias for `TileSheet:getTextureName`.
|
||||
---@param x number
|
||||
---@param y number
|
||||
---@return string
|
||||
|
||||
Reference in New Issue
Block a user