core/background: get screen size from screen object
This commit is contained in:
parent
cfdeefe301
commit
20d617408a
|
@ -28,10 +28,11 @@ function Background:new(filepath)
|
|||
self.image = love.graphics.newImage(filepath)
|
||||
self.batch = love.graphics.newSpriteBatch(self.image , 1000 )
|
||||
|
||||
self.width, self.height = self.image:getDimensions()
|
||||
self.width, self.height = self.image:getDimensions()
|
||||
screenwidth, screenheight = core.screen:getDimensions()
|
||||
|
||||
local w = math.floor(424 / self.width) * self.width + 1
|
||||
local h = math.floor(240 / self.height) * self.height + 1
|
||||
local w = math.floor(screenwidth / self.width) * self.width + 1
|
||||
local h = math.floor(screenheight / self.height) * self.height + 1
|
||||
|
||||
for i=-1, w do
|
||||
for j=-1, h do
|
||||
|
|
Loading…
Reference in New Issue