diff --git a/draw2d.cm b/draw2d.cm index f92fdc0c..bf1915a3 100644 --- a/draw2d.cm +++ b/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 } diff --git a/point.cm b/point.cm new file mode 100644 index 00000000..4bbb7658 --- /dev/null +++ b/point.cm @@ -0,0 +1,8 @@ +var point = {} + +point.add = function(a,b) +{ + return {x: a.x+b.x, y: a.y+b.y} +} + +return point \ No newline at end of file