Added getObjectTileBounds() to get the bounds of a particular object in a
scene. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1663 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: IsoSceneView.java,v 1.117 2002/07/08 21:41:30 mdb Exp $
|
||||
// $Id: IsoSceneView.java,v 1.118 2002/09/05 02:21:54 shaper Exp $
|
||||
|
||||
package com.threerings.miso.scene;
|
||||
|
||||
@@ -637,6 +637,22 @@ public class IsoSceneView implements SceneView
|
||||
return _hcoords;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the bounds of the given object in the scene in screen
|
||||
* coordinates, or <code>null</code> if there is no such object.
|
||||
*/
|
||||
public Rectangle getObjectTileBounds (int x, int y, ObjectTile tile)
|
||||
{
|
||||
Iterator iter = _objects.iterator();
|
||||
while (iter.hasNext()) {
|
||||
ObjectMetrics metrics = (ObjectMetrics)iter.next();
|
||||
if (metrics.tile == tile && metrics.x == x && metrics.y == y) {
|
||||
return metrics.bounds;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the supplied screen coordinates into tile coordinates,
|
||||
* writing the values into the supplied {@link Point} instance and
|
||||
|
||||
Reference in New Issue
Block a user