fpv/source/backgroundSprite.lua

16 lines
382 B
Lua
Raw Normal View History

2024-05-29 17:38:50 +03:00
local pd <const> = playdate
local gfx <const> = playdate.graphics
class("BackGround").extends()
function BackGround:init(x, y)
gfx.sprite.setBackgroundDrawingCallback(
function (x, y, width, height)
local groundImage = playdate.graphics.image.new("sprites/bg")
gfx.setClipRect(x, y, width, height)
groundImage:draw(0,0)
gfx.clearClipRect()
end
)
end