[Papervision3D] using TextFieldAutoSize.LEFT seems to stretch text when used as material for do3d

craig kincaid craig.kincaid at citrus.com.au
Sun Jan 4 21:46:57 PST 2009


I used the code in this example  http://pv3d.org/tag/pivot-point/
http://pv3d.org/tag/pivot-point/  and it seemed to work, here is the code I
used (in case anyone gets this through a search) not sure why it works now
as opposed to before tho?

public var movieClip:MovieClip		
public var planeGroup:DisplayObject3D		
public var textField:TextField;
public var navUpTextFormat:TextFormat = new TextFormat("Trebuchet MS", 52,
"0x999999");

public function createNavItem(buttLabel:String,
materialType:FlatShadeMaterial, buttNum:Number):DisplayObject3D
		{
 
			planeGroup = new DisplayObject3D();

			var bgnd:Plane = new Plane(materialType, itemWidth, itemHeight, 9, 9)
			bgnd.z = 1
			planeGroup.addChild(bgnd)

			movieClip = new MovieClip();
			movieClip.graphics.drawRect(0,0,itemWidth,itemHeight);
 
			textField = new TextField();
			textField.y = 20
			textField.autoSize = TextFieldAutoSize.LEFT;
			textField.antiAliasType = AntiAliasType.NORMAL;
			textField.defaultTextFormat = navUpTextFormat;
			textField.text = buttLabel.toUpperCase();
			movieClip.addChild(textField);
 
			var movieMaterial:MovieMaterial = new MovieMaterial(movieClip, true,
true, true);
			movieMaterial.smooth = true;
			movieMaterial.interactive = true;
			movieMaterial.doubleSided = true
 
			var planeFront:Plane = new Plane(movieMaterial);
			planeGroup.addChild(planeFront);
			planeGroup.x = initXpos
          	planeGroup.y = initYpos +((itemHeight + navGap)* buttNum)
          	planeGroup.z = initZpos
			planeGroup.scale = 1

			return(planeGroup)
		}


-- 
View this message in context: http://www.nabble.com/using-TextFieldAutoSize.LEFT-seems-to-stretch-text-when-used-as-material-for-do3d-tp21225947p21285902.html
Sent from the Papervision3D mailing list archive at Nabble.com.




More information about the Papervision3D mailing list