fix modules
This commit is contained in:
10
draw2d.cm
10
draw2d.cm
@@ -1,6 +1,6 @@
|
||||
var math = use('math')
|
||||
var color = use('color')
|
||||
var gamestate = use('gamestate')
|
||||
var prosperon = use('prosperon')
|
||||
|
||||
var draw = {}
|
||||
|
||||
@@ -217,9 +217,9 @@ draw.grid = function grid(rect, spacing, thickness = 1, offset = {x: 0, y: 0}, m
|
||||
draw.scissor = function(rect)
|
||||
{
|
||||
var screen_rect = null
|
||||
if (rect && gamestate.camera) {
|
||||
var bottom_left = gamestate.camera.world_to_window(rect.x, rect.y)
|
||||
var top_right = gamestate.camera.world_to_window(rect.x + rect.width, rect.y + rect.height)
|
||||
if (rect && prosperon.camera) {
|
||||
var bottom_left = prosperon.camera.world_to_window(rect.x, rect.y)
|
||||
var top_right = prosperon.camera.world_to_window(rect.x + rect.width, rect.y + rect.height)
|
||||
var screen_left = bottom_left.x
|
||||
var screen_top = bottom_left.y
|
||||
var screen_right = top_right.x
|
||||
@@ -233,7 +233,7 @@ draw.scissor = function(rect)
|
||||
}
|
||||
|
||||
// TODO: must be a better way than manually inverting here. Some camera specific function.
|
||||
var sensor = gamestate.camera.sensor()
|
||||
var sensor = prosperon.camera.sensor()
|
||||
screen_rect.y = sensor.height - screen_rect.y - screen_rect.height
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user