Package com.threerings.media.tile

Examples of com.threerings.media.tile.UniformTileSet


     * Computes a set of display objects for the portals in this scene.
     */
    protected void recomputePortals ()
    {
        // create scene objects for our portals
        UniformTileSet ots = loadPortalTileSet();

        _portobjs.clear();
        for (Iterator<Portal> iter = _scene.getPortals(); iter.hasNext(); ) {
            Portal portal = iter.next();
            StageLocation loc = (StageLocation) portal.loc;
            Point p = getScreenCoords(loc.x, loc.y);
            int tx = MisoUtil.fullToTile(loc.x);
            int ty = MisoUtil.fullToTile(loc.y);
            Point ts = MisoUtil.tileToScreen(_metrics, tx, ty, new Point());

//             log.info("Added portal", "portal", portal, "screen", StringUtil.toString(p), "tile",
//                StringUtil.coordsToString(tx, ty), "tscreen", StringUtil.toString(ts));

            ObjectInfo info = new ObjectInfo(0, tx, ty);
            info.action = "portal:" + portal.portalId;

            // TODO: cache me
            ObjectTile tile = new PortalObjectTile(
                ts.x + _metrics.tilehwid - p.x + (PORTAL_ICON_WIDTH / 2),
                ts.y + _metrics.tilehei - p.y + (PORTAL_ICON_HEIGHT / 2));
            tile.setImage(ots.getTileMirage(loc.orient));

            _portobjs.add(new SceneObject(this, info, tile) {
                @Override
                public boolean setHovered (boolean hovered) {
                    ((PortalObjectTile)this.tile).hovered = hovered;
View Full Code Here


        // use of flowlayout positions the toolbar and floats properly
        setLayout(new FlowLayout(FlowLayout.LEFT));

        // get our toolbar icons
        UniformTileSet tbset = tilemgr.loadTileSet(ICONS_PATH, 40, 40);

        // create the toolbar
        JToolBar toolbar = new JToolBar();

        // add all of the toolbar buttons
        _buttons = Lists.newArrayList();
        for (int ii = 0; ii < EditorModel.NUM_ACTIONS; ii++) {
            // get the button icon images
            Tile tile = tbset.getTile(ii);
            if (tile != null) {
                String cmd = EditorModel.CMD_ACTIONS[ii];
                String tip = EditorModel.TIP_ACTIONS[ii];

                // create the button
View Full Code Here

TOP

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

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.