Package com.threerings.miso.client

Examples of com.threerings.miso.client.SceneObject


            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;
                    return isResponsive();
                }
View Full Code Here


    {
        super.recomputeVisible();

        // add our visible portal objects to the list of visible objects
        for (int ii = 0, ll = _portobjs.size(); ii < ll; ii++) {
            SceneObject pobj = _portobjs.get(ii);
            if (pobj.bounds != null && _vbounds.intersects(pobj.bounds)) {
                _vizobjs.add(pobj);
            }
        }
    }
View Full Code Here

        // bail if we're not hovering over a scene object
        if (_hobject == null || !(_hobject instanceof SceneObject)) {
            return;
        }

        SceneObject scObj = (SceneObject)_hobject;
        int tileSetId = TileUtil.getTileSetId(scObj.info.tileId);
        int tileIndex = TileUtil.getTileIndex(scObj.info.tileId);
        _emodel.setTile(scObj.tile.key.tileSet, tileSetId, tileIndex);
        _emodel.setLayerIndex(EditorModel.OBJECT_LAYER);
    }
View Full Code Here

    {
        super.hoverObjectChanged(oldHover, newHover);

        // we always repaint our objects when the hover changes
        if (oldHover instanceof SceneObject) {
            SceneObject oldhov = (SceneObject)oldHover;
            _remgr.invalidateRegion(oldhov.getObjectFootprint().getBounds());
        }
        if (newHover instanceof SceneObject) {
            SceneObject newhov = (SceneObject)newHover;
            _remgr.invalidateRegion(newhov.getObjectFootprint().getBounds());
        }
    }
View Full Code Here

        _ptile = tile;

        // if this is an object tile, create a temporary scene object we
        // can use to perform calculations with the object while placing
        if (_ptile instanceof ObjectTile) {
            _pscobj = new SceneObject(this, new ObjectInfo(0, _ppos.x, _ppos.y), (ObjectTile)tile);
        } else {
            _pscobj = null;
        }
    }
View Full Code Here

    protected void paintHighlights (Graphics2D gfx, Rectangle dirty)
    {
        Polygon hpoly = null;

        if (_hobject != null && _hobject instanceof SceneObject) {
            SceneObject scobj = (SceneObject)_hobject;
            hpoly = scobj.getObjectFootprint();

        }

        if (_emodel.getActionMode() == EditorModel.ACTION_PLACE_TILE &&
            (hpoly == null ||
View Full Code Here

     */
    protected boolean isTilePlacementValid (int x, int y, Tile tile)
    {
        if (tile instanceof ObjectTile) {
            // create a temporary scene object for this tile
            SceneObject nobj = new SceneObject(this, new ObjectInfo(0, x, y), (ObjectTile)tile);
            // report invalidity if overlaps any existing objects
            int ocount = _vizobjs.size();
            for (int ii = 0; ii < ocount; ii++) {
                SceneObject scobj = _vizobjs.get(ii);
                if (scobj.objectFootprintOverlaps(nobj)) {
                    return false;
                }
            }
        }

View Full Code Here

TOP

Related Classes of com.threerings.miso.client.SceneObject

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.