2025-08-22 01:21:15 +03:00

31 lines
730 B
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--- @class Tile
--- @field isClip boolean
--- @field quad love.Quad
local tile = {}
tile.__index = tile
--- TODO: сделать как love.graphics.draw несколько сигнатур у функции
--- @param x number
--- @param y number
--- @param tileSize number
--- @param atlas love.Image
--- @param isClip boolean
local function new(x, y, tileSize, atlas, isClip)
local quad = love.graphics.newQuad(x, y, tileSize, tileSize, atlas)
return setmetatable({
isClip = isClip,
quad = quad
})
end
--- @param quad love.Quad
--- @param isClip boolean
local function fromQuad(quad, isClip)
return setmetatable({
isClip = isClip,
quad = quad
})
end
return { new = new }