Package com.threerings.media.tile

Examples of com.threerings.media.tile.TileSet


    @Override
    public TileSet getTileSet (int tileSetId)
        throws NoSuchTileSetException
    {
        TileSet testSet = _testSets.get(tileSetId);
        if (testSet != null) {
            return testSet;
        } else {
            return super.getTileSet(tileSetId);
        }
View Full Code Here


            }

            Iterator<Integer> tsids = tsrepo.enumerateTileSetIds();
            while (tsids.hasNext()) {
                Integer tsid = tsids.next();
                TileSet set = tsrepo.getTileSet(tsid.intValue());

                // determine which layer to which this tileset applies
                int lidx = TileSetUtil.getLayerIndex(set);
                if (lidx != -1) {
                    TileSetRecord rec = new TileSetRecord(lidx, tsid.intValue(), set);
View Full Code Here

            ((EditorTileManager)tileMgr).clearTestTileSets();
        }

        // insert the new test tiles
        for (Integer tsid : tests.keySet()) {
            TileSet set = tests.get(tsid);

            // determine which layer to which this tileset applies
            int lidx = TileSetUtil.getLayerIndex(set);
            if (lidx != -1) {
                // make up a negative number to refer to this temporary tileset
View Full Code Here

            return;
        }

        // set row heights to match the scaled tile image heights
        int numTiles = getTileCount();
        TileSet set = _model.getTileSet();
        for (int ii = 0; ii < numTiles; ii++) {
            Image img = set.getRawTileImage(ii);
            int hei = getScaledTileImageHeight(img);
            _tiletable.setRowHeight(ii, hei + (2 * EDGE_TILE_V));
        }

        // select the selected tile
View Full Code Here

    {
        if (!_model.isTileValid()) {
            return 0;

        } else {
            TileSet set = _model.getTileSet();
            return (set == null) ? 0 : set.getTileCount();
        }
    }
View Full Code Here

        // set our title to the name of the tileset and the tile index
        String title;
        int tsid = TileUtil.getTileSetId(scobj.info.tileId);
        int tidx = TileUtil.getTileIndex(scobj.info.tileId);
        TileSet tset = null;
        try {
            tset = _ctx.getTileManager().getTileSet(tsid);
            title = tset.getName() + ": " + tidx;
        } catch (NoSuchTileSetException nstse) {
            title = "Error(" + tsid + "): " + tidx;
        }
        title += " (" + StringUtil.coordsToString(_scobj.info.x, _scobj.info.y) + ")";
        setTitle(title);
View Full Code Here

                continue;
            }

            Iterator<TileSet> iter = tiles.values().iterator();
            while (iter.hasNext()) {
                TileSet ts = iter.next();
                String path = new File(directory, ts.getImagePath()).getPath();

                // before we insert, make sure we can load the image
                if (null != _improv.getTileSetImage(path, null)) {
                    ts.setImageProvider(_improv);
                    ts.setImagePath(path);
                    sets.put(getTileSetID(path), ts);
                }
            }
        }
    }
View Full Code Here

        final TreeSet<String> set = Sets.newTreeSet();
        StageMisoSceneModel msmodel = StageMisoSceneModel.getSceneModel(_scene.getSceneModel());
        msmodel.visitObjects(new ObjectVisitor() {
            public void visit (ObjectInfo info) {
                int tsid = TileUtil.getTileSetId(info.tileId);
                TileSet tset;
                try {
                    tset = tilemgr.getTileSet(tsid);
                } catch (NoSuchTileSetException nstse) {
                    return;
                }
View Full Code Here

            if (_icons[row] != null) {
                return _icons[row];
            }

            // generate and save off the tile image scaled to fit the table
            TileSet set = _model.getTileSet();
            Image img = set.getRawTileImage(row);
            int hei = getScaledTileImageHeight(img);

            if (hei != img.getHeight(null)) {
                img = img.getScaledInstance(_tablewid, hei, Image.SCALE_SMOOTH);
            }
View Full Code Here

TOP

Related Classes of com.threerings.media.tile.TileSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.