DNESS / cocos2d-iphone

Automatically exported from code.google.com/p/cocos2d-iphone
1 stars 0 forks source link

CCProgressTimer Radial works only with default anchorPoint. #1300

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create CCProgressTimer with any radial type.
2. Set it's anchor point to i.e. ccp(0,1)

What is the expected output? What do you see instead?
Expected: it should be positioned as a sprite.
See instead: no progress timer rendered at all.

What cocos2d version are you using ?
1.x current develop.

Original issue reported on code.google.com by psi.pk...@gmail.com on 14 Jan 2012 at 3:43

GoogleCodeExporter commented 9 years ago
I just ran into this as well. It looks like the code in the updateRadial method 
of assumes that the anchorpoint is the midpoint. This could, in theory, allow 
for slightly off-center radial transitions, but seems rarely useful in practice 
and does not work at all in the extremes.

The line:
    //  Grab the midpoint
    CGPoint midpoint = ccpCompMult(self.anchorPoint, tMax);

Can be changed to the following to always use the center:
    //  Grab the midpoint
    CGPoint midpoint = ccpMult(tMax, 0.5f);

Original comment by Smoo.Mas...@gmail.com on 19 Jan 2012 at 4:49

GoogleCodeExporter commented 9 years ago
Which cocos2d version are you using ? 1.0 or 2.0 ?

Original comment by ricardoq...@gmail.com on 19 Jan 2012 at 5:41

GoogleCodeExporter commented 9 years ago
I am using 1.1 beta. The code appears to be the same in 1.0.1.

2.0 has a separate variable called midpoint that appears to be for a similar 
purpose to CCProgressTimer's use of anchorPoint in 1.0. This implies that the 
use of anchorPoint in 1.0 was deliberate, although not helpful in most cases 
(in my opinion at least).

Original comment by Smoo.Mas...@gmail.com on 19 Jan 2012 at 5:58

GoogleCodeExporter commented 9 years ago
I can reproduce this issue in 1.0.1.

Original comment by solkar.s...@gmail.com on 13 Jul 2012 at 6:54