Added checkbox to toggle display of tile coordinates in scene view.
Made separate scene panel for layer selection and coords toggle, renamed previous ScenePanel to SceneViewPanel for posterity. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@81 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: DisplayMisoSceneImpl.java,v 1.6 2001/07/18 21:45:42 shaper Exp $
|
// $Id: DisplayMisoSceneImpl.java,v 1.7 2001/07/20 00:35:09 shaper Exp $
|
||||||
|
|
||||||
package com.threerings.miso.scene;
|
package com.threerings.miso.scene;
|
||||||
|
|
||||||
@@ -206,8 +206,8 @@ public class Scene
|
|||||||
protected static final short VERSION = 1;
|
protected static final short VERSION = 1;
|
||||||
|
|
||||||
// scene width/height in tiles
|
// scene width/height in tiles
|
||||||
protected static final int TILE_WIDTH = 50;
|
protected static final int TILE_WIDTH = 21;
|
||||||
protected static final int TILE_HEIGHT = 70;
|
protected static final int TILE_HEIGHT = 21;
|
||||||
|
|
||||||
// layer identifiers and total number of layers
|
// layer identifiers and total number of layers
|
||||||
protected static final int LAYER_BASE = 0;
|
protected static final int LAYER_BASE = 0;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: IsoSceneView.java,v 1.9 2001/07/19 23:11:27 shaper Exp $
|
// $Id: IsoSceneView.java,v 1.10 2001/07/20 00:35:09 shaper Exp $
|
||||||
|
|
||||||
package com.threerings.miso.scene;
|
package com.threerings.miso.scene;
|
||||||
|
|
||||||
@@ -37,6 +37,8 @@ public class IsoSceneView implements SceneView
|
|||||||
_lineX[ii] = new Point();
|
_lineX[ii] = new Point();
|
||||||
_lineY[ii] = new Point();
|
_lineY[ii] = new Point();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_showCoords = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void paint (Graphics g)
|
public void paint (Graphics g)
|
||||||
@@ -81,7 +83,7 @@ public class IsoSceneView implements SceneView
|
|||||||
gfx.drawImage(tile.img, screenX, ypos, null);
|
gfx.drawImage(tile.img, screenX, ypos, null);
|
||||||
|
|
||||||
// draw tile coordinates in each tile
|
// draw tile coordinates in each tile
|
||||||
paintCoords(gfx, tx, ty, screenX, screenY);
|
if (_showCoords) paintCoords(gfx, tx, ty, screenX, screenY);
|
||||||
|
|
||||||
// draw an outline around the highlighted tile
|
// draw an outline around the highlighted tile
|
||||||
if (tx == _htile.x && ty == _htile.y) {
|
if (tx == _htile.x && ty == _htile.y) {
|
||||||
@@ -225,6 +227,11 @@ public class IsoSceneView implements SceneView
|
|||||||
_scene = scene;
|
_scene = scene;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setShowCoordinates (boolean show)
|
||||||
|
{
|
||||||
|
_showCoords = show;
|
||||||
|
}
|
||||||
|
|
||||||
public void setTile (int x, int y, int lnum, Tile tile)
|
public void setTile (int x, int y, int lnum, Tile tile)
|
||||||
{
|
{
|
||||||
Point tpos = screenToTile(x, y);
|
Point tpos = screenToTile(x, y);
|
||||||
@@ -252,6 +259,8 @@ public class IsoSceneView implements SceneView
|
|||||||
|
|
||||||
protected Font _font;
|
protected Font _font;
|
||||||
|
|
||||||
|
protected boolean _showCoords;
|
||||||
|
|
||||||
protected Scene _scene;
|
protected Scene _scene;
|
||||||
protected TileManager _tmgr;
|
protected TileManager _tmgr;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: SceneView.java,v 1.5 2001/07/19 00:22:02 shaper Exp $
|
// $Id: SceneView.java,v 1.6 2001/07/20 00:35:09 shaper Exp $
|
||||||
|
|
||||||
package com.threerings.miso.scene;
|
package com.threerings.miso.scene;
|
||||||
|
|
||||||
@@ -30,6 +30,11 @@ public interface SceneView
|
|||||||
*/
|
*/
|
||||||
public void setScene (Scene scene);
|
public void setScene (Scene scene);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set whether coordinates should be drawn for each tile.
|
||||||
|
*/
|
||||||
|
public void setShowCoordinates (boolean show);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the tile at the specified location and layer in the scene.
|
* Set the tile at the specified location and layer in the scene.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user