Centering MovieClipSprite(s)

1 view
Skip to first unread message

nathan

unread,
Jul 9, 2008, 3:39:07 AM7/9/08
to away3d.dev
Hey guys,

I have an ObjectContainer3D and it has an object 3D at 0,0,0 and a
MovieClipSprite at 0,0,0. Trouble is the MovieClipSprite is anything
but centered in the container.

Any ideas on what values I should be using to get the MovieClipSprite
centered?

I have scaled the movieclip a bit before using it in the constructor
of MovieClipSprite, will that mess it up?

Thanks,
Nathan

Peter Kapelyan

unread,
Jul 9, 2008, 9:17:27 AM7/9/08
to away3...@googlegroups.com
Hi Nathan,
 
Not to sure about the values but there is the .movePivot(x,y,z) which could recenter it depending on the values you might find.

Also a snippet of code would help locate the problem, if it is some bug in fact.

-Pete

--
___________________

Actionscript 3.0 Flash 3D Graphics Engine

HTTP://AWAY3D.COM

buganamo

unread,
Jul 9, 2008, 12:30:02 PM7/9/08
to away3d.dev
PLEASE respond with snippet of code, I was having the same problem and
it's driving me to the bottle (or Sprite2D, either way, neither is
what I'm after)!!

Rob Bateman

unread,
Jul 9, 2008, 1:36:09 PM7/9/08
to away3...@googlegroups.com
hey nathan

movieclipsprite will only rescale the object if rescale is set to true (default is false)

as far as positioning goes, the reference point used is calulated from the actual reference point of the clip plus half the width and the height. This means that if your content within the movieclip is not aligned top-left (ie. with it's top edge at 0 y and it's left edge at 0 x) there will be some problems getting it to center.

if you're still having problems, why not send over a sample of the movieclip you're trying to use?

atb

Rob
--
Rob Bateman
Flash Development & Consultancy

rob.b...@gmail.com
www.infiniteturtles.co.uk
www.away3d.com

nathan

unread,
Jul 9, 2008, 9:31:58 PM7/9/08
to away3d.dev
Ok, great thanks, will have a bit more of a play
> rob.bate...@gmail.comwww.infiniteturtles.co.ukwww.away3d.com- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages