When we move the scene, we need to wait a tick for the blocks to get in place before we move ourselves. Otherwise we get exciting blank regions.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@956 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -257,20 +257,22 @@ public class MisoScenePanel extends Sprite
|
||||
|
||||
_objScene.render();
|
||||
|
||||
// Then we let the scene finally move if it's trying to...
|
||||
if (_pendingMoveBy != null) {
|
||||
_isoView.centerOnPt(new Pt(_pendingMoveBy.x + _isoView.currentX,
|
||||
_pendingMoveBy.y + _isoView.currentY), false);
|
||||
_pendingMoveBy = null;
|
||||
}
|
||||
|
||||
// Now, take out any old blocks no longer in our valid blocks.
|
||||
var blocks :Set = getBaseBlocks();
|
||||
for each (var baseKey :int in _blocks.keys()) {
|
||||
if (!blocks.contains(baseKey)) {
|
||||
_blocks.remove(baseKey).release();
|
||||
DelayUtil.delayFrame(function() :void {
|
||||
// Then we let the scene finally move if it's trying to...
|
||||
if (_pendingMoveBy != null) {
|
||||
_isoView.centerOnPt(new Pt(_pendingMoveBy.x + _isoView.currentX,
|
||||
_pendingMoveBy.y + _isoView.currentY), false);
|
||||
_pendingMoveBy = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Now, take out any old blocks no longer in our valid blocks.
|
||||
var blocks :Set = getBaseBlocks();
|
||||
for each (var baseKey :int in _blocks.keys()) {
|
||||
if (!blocks.contains(baseKey)) {
|
||||
_blocks.remove(baseKey).release();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected function refreshScene () :void
|
||||
|
||||
Reference in New Issue
Block a user