From 01c5c700647feba596e02cb7a2e672f5301504ff Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Mon, 29 Jun 2015 12:32:00 +0200 Subject: Port to scala 2.11 --- src/main/scala/graphyx/graphics/GraphicalAABB.scala | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/main/scala/graphyx/graphics/GraphicalAABB.scala (limited to 'src/main/scala/graphyx/graphics/GraphicalAABB.scala') diff --git a/src/main/scala/graphyx/graphics/GraphicalAABB.scala b/src/main/scala/graphyx/graphics/GraphicalAABB.scala new file mode 100644 index 0000000..cb3694b --- /dev/null +++ b/src/main/scala/graphyx/graphics/GraphicalAABB.scala @@ -0,0 +1,18 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.graphics + +import sims.collision._ +class GraphicalAABB(val real: AABB) extends AABB(real.minVertex, real.maxVertex) with GraphicalObject { + override def draw() = { + g.setColor(java.awt.Color.BLACK) + g.drawRect((minVertex.x * scale * ppm).toInt, + correctY(maxVertex.y * scale * ppm).toInt, + ((maxVertex - minVertex).x * scale * ppm).toInt, + ((maxVertex - minVertex).y * scale * ppm).toInt) + } +} -- cgit v1.2.3