modules/world: add a view number limit
This commit is contained in:
parent
79ecdc822b
commit
699efeb2fb
1 changed files with 9 additions and 6 deletions
|
@ -28,6 +28,7 @@ local CameraSystem = Object:extend()
|
|||
local View = require(cwd .. "libs.hump.camera")
|
||||
|
||||
local SPLITSCREEN_ISVERTICAL = false
|
||||
local SCREEN_LIMIT = 4
|
||||
|
||||
-- INIT FUNCTIONS
|
||||
-- Initialize the camera system
|
||||
|
@ -63,6 +64,7 @@ end
|
|||
-- Access data from the views
|
||||
|
||||
function CameraSystem:addView(x, y)
|
||||
if (#self.view.list < SCREEN_LIMIT) then
|
||||
local view = {}
|
||||
|
||||
view.cam = View(x, y, 1, 0, true)
|
||||
|
@ -71,6 +73,7 @@ function CameraSystem:addView(x, y)
|
|||
|
||||
table.insert(self.views.list, view)
|
||||
end
|
||||
end
|
||||
|
||||
function CameraSystem:getView(id)
|
||||
return self.views.list[id]
|
||||
|
|
Loading…
Reference in a new issue