Fancier iso sprites for the character - let the scene panel extension define the display object to show.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@948 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -19,19 +19,32 @@
|
||||
|
||||
package com.threerings.stage.client {
|
||||
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Sprite;
|
||||
|
||||
import com.threerings.miso.util.MisoSceneMetrics;
|
||||
import com.threerings.miso.util.MisoUtil;
|
||||
import com.threerings.stage.data.StageLocation;
|
||||
|
||||
import as3isolib.display.primitive.IsoBox;
|
||||
import as3isolib.display.IsoSprite;
|
||||
import as3isolib.graphics.SolidColorFill;
|
||||
|
||||
public class CharacterIsoSprite extends IsoBox
|
||||
public class CharacterIsoSprite extends IsoSprite
|
||||
{
|
||||
public function CharacterIsoSprite (bodyOid :int, metrics :MisoSceneMetrics)
|
||||
public function CharacterIsoSprite (bodyOid :int, metrics :MisoSceneMetrics,
|
||||
disp :DisplayObject)
|
||||
{
|
||||
_metrics = metrics;
|
||||
_bodyOid = bodyOid;
|
||||
setSize(1, 1, 2);
|
||||
|
||||
// We wrap the sprite so we can shift it where we need it. Components like to line up
|
||||
// to the middle of a tile and as3isolib likes to line up to the back of a tile.
|
||||
var wrapper :Sprite = new Sprite();
|
||||
wrapper.y = _metrics.tilehhei;
|
||||
wrapper.addChild(disp);
|
||||
|
||||
sprites = [wrapper];
|
||||
}
|
||||
|
||||
public function isMoving () :Boolean
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
|
||||
package com.threerings.stage.client {
|
||||
|
||||
import flash.display.DisplayObject;
|
||||
|
||||
import flash.geom.Point;
|
||||
import flash.geom.Rectangle;
|
||||
|
||||
@@ -569,7 +571,12 @@ public class CrowdStageScenePanel extends StageScenePanel
|
||||
|
||||
protected function createSprite (info :OccupantInfo) :CharacterIsoSprite
|
||||
{
|
||||
return new CharacterIsoSprite(info.getBodyOid(), _metrics);
|
||||
return new CharacterIsoSprite(info.getBodyOid(), _metrics, createCharacter(info));
|
||||
}
|
||||
|
||||
protected function createCharacter (info :OccupantInfo) :DisplayObject
|
||||
{
|
||||
throw new Error("abstract");
|
||||
}
|
||||
|
||||
protected function getSprite (bodyOid :int) :CharacterIsoSprite
|
||||
|
||||
Reference in New Issue
Block a user