[Xerte] setScale()
Julian Tenney
Julian.Tenney at nottingham.ac.uk
Mon Oct 13 09:43:05 BST 2008
If I'm understanding correctly, you want to keep the image in the centre
of the screen as it scales, right? The top right corner of the image
needs to move., so if you're doing this in an onEnterFrame:
img.setScale(scale--); //scale defined at 100 before the event is fired
img._x = 400 - img._width / 2; //keep it centred where the centre is at
400, 247
img._y = 247 - img._height / 2;
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Paul Beckwith
Sent: Monday, October 13, 2008 9:33 AM
To: 'Xerte discussion list'
Subject: RE: [Xerte] setScale()
Can't reposition the image as it's centred on the page and needs to be
shown reducing in size...?
________________________________
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Julian Tenney
Sent: 13 October 2008 09:26
To: Xerte discussion list
Subject: RE: [Xerte] setScale()
No, the origin is at 0,0. You need to also reposition the image.
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Paul Beckwith
Sent: Monday, October 13, 2008 9:25 AM
To: xerte at lists.nottingham.ac.uk
Subject: [Xerte] setScale()
Hi guys,
When I use the setScale() function in Xerte to reduce the size of an
image it scales as if someone is dragging the bottom right of the image
to scale it. Is there any way of making it shrink in proportion with a
tween?
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20081013/cdb50611/attachment.html
More information about the Xerte
mailing list