16 lines
382 B
Lua
16 lines
382 B
Lua
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
|