Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClipRect and pivot #444

Closed
ffelini opened this issue Nov 28, 2013 · 4 comments
Closed

ClipRect and pivot #444

ffelini opened this issue Nov 28, 2013 · 4 comments
Labels

Comments

@ffelini
Copy link

ffelini commented Nov 28, 2013

If we have a sprite with some images in there and we set the clipRect for instance a half of its size everything is good. ClipRect is set properly and if we move some of his children that are out of this "viewPort" to the clipping area then it is drawn proprly also.

The problem is with pivots of the clipped sprite.
If we animate the pivots properties of an clipped sprite then nothig out of this clipping area that moves to the clipping are is rendered.

Don't know if it is a bug of possible limitation of the clipping implementation :)

@PrimaryFeather
Copy link
Contributor

Sorry for the late reply!

Hm, indeed, that sounds like a bug. Could you maybe send me a code sample that shows what happens -- compared to what ought to happen? That would make it easier for me to get it fixed.

Thanks in advance!

@ffelini
Copy link
Author

ffelini commented Dec 17, 2013

var sprite:Sprite = new Sprite();
var quad:Quad = new Quad(300,300,0x66CC00);

sprite.addChild(quad);

sprite.clipRect = new Rectangle(sprite.width/2,sprite.height);

var t:Tween = new Tween(sprite,2000);
t.animate("pivotX",-sprite.width/2);
t.onComplete = function():void { t.animate"pivotX",sprite.width/2; Starling.juggler.add(t); };
Starling.juggler.add(t);

this code should animate pivotX property for the sprite with a clipRect of half size of himself. Content of the sprite should move from side to side and clipRect should affect properly his content.
I think this use case wasn't just taken in consideration.

Thank's in advance

@PrimaryFeather
Copy link
Contributor

Thanks for the sample! I'll look into this after the Christmas holidays. If you get to a point where it's critical that it's fixed, just ping me!!

@PrimaryFeather
Copy link
Contributor

Hm, sorry, it seems that issue somehow slipped my attention. Sorry for that!
The good news is that it shouldn't be a problem in Starling 2, since clipRects are no longer available. 😉 Well, in fact they are now just an optimization of the mask property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants