From 1da63af67fe714ab57d62fc8613b108b47d5f2fa Mon Sep 17 00:00:00 2001 From: Walter Korman Date: Fri, 20 Jul 2001 00:35:09 +0000 Subject: [PATCH] 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 --- .../miso/client/DisplayMisoSceneImpl.java | 6 +++--- .../com/threerings/miso/client/IsoSceneView.java | 15 ++++++++++++--- .../com/threerings/miso/client/SceneView.java | 7 ++++++- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/java/com/threerings/miso/client/DisplayMisoSceneImpl.java b/src/java/com/threerings/miso/client/DisplayMisoSceneImpl.java index 3f4e0974f..d16b80c68 100644 --- a/src/java/com/threerings/miso/client/DisplayMisoSceneImpl.java +++ b/src/java/com/threerings/miso/client/DisplayMisoSceneImpl.java @@ -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; @@ -206,8 +206,8 @@ public class Scene protected static final short VERSION = 1; // scene width/height in tiles - protected static final int TILE_WIDTH = 50; - protected static final int TILE_HEIGHT = 70; + protected static final int TILE_WIDTH = 21; + protected static final int TILE_HEIGHT = 21; // layer identifiers and total number of layers protected static final int LAYER_BASE = 0; diff --git a/src/java/com/threerings/miso/client/IsoSceneView.java b/src/java/com/threerings/miso/client/IsoSceneView.java index 82928cd2d..f8eee1aab 100644 --- a/src/java/com/threerings/miso/client/IsoSceneView.java +++ b/src/java/com/threerings/miso/client/IsoSceneView.java @@ -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; @@ -20,7 +20,7 @@ public class IsoSceneView implements SceneView public IsoSceneView (TileManager tmgr) { _tmgr = tmgr; - + _bounds = new Rectangle(0, 0, DEF_BOUNDS_WIDTH, DEF_BOUNDS_HEIGHT); _htile = new Point(); @@ -37,6 +37,8 @@ public class IsoSceneView implements SceneView _lineX[ii] = new Point(); _lineY[ii] = new Point(); } + + _showCoords = false; } public void paint (Graphics g) @@ -81,7 +83,7 @@ public class IsoSceneView implements SceneView gfx.drawImage(tile.img, screenX, ypos, null); // 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 if (tx == _htile.x && ty == _htile.y) { @@ -225,6 +227,11 @@ public class IsoSceneView implements SceneView _scene = scene; } + public void setShowCoordinates (boolean show) + { + _showCoords = show; + } + public void setTile (int x, int y, int lnum, Tile tile) { Point tpos = screenToTile(x, y); @@ -252,6 +259,8 @@ public class IsoSceneView implements SceneView protected Font _font; + protected boolean _showCoords; + protected Scene _scene; protected TileManager _tmgr; } diff --git a/src/java/com/threerings/miso/client/SceneView.java b/src/java/com/threerings/miso/client/SceneView.java index b6e8ecc1d..2d5f71c6c 100644 --- a/src/java/com/threerings/miso/client/SceneView.java +++ b/src/java/com/threerings/miso/client/SceneView.java @@ -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; @@ -30,6 +30,11 @@ public interface SceneView */ 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. */