Open GoogleCodeExporter opened 9 years ago
[deleted comment]
[deleted comment]
since my project has targets to iOS and MAC on the file "ccMacros.h" to modify
the value for CC_CONTENT_SCALE_FACTOR() I did the following:
[...]
/****************************/
/** RETINA DISPLAY ENABLED **/
/****************************/
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED)
/** @def CC_CONTENT_SCALE_FACTOR
On Mac it returns 1;
On iPhone it returns 2 if RetinaDisplay is On. Otherwise it returns 1
*/
#import "Platforms/iOS/CCDirectorIOS.h"
#define CC_CONTENT_SCALE_FACTOR() __ccContentScaleFactor
#elif defined(__MAC_OS_X_VERSION_MAX_ALLOWED)
#define CC_CONTENT_SCALE_FACTOR() 2.0f
#endif
[...]
Original comment by neves.jhenrique@gmail.com
on 27 Mar 2012 at 7:02
Original comment by ricardoq...@gmail.com
on 27 Mar 2012 at 7:36
Original comment by ricardoq...@gmail.com
on 27 Mar 2012 at 7:37
[deleted comment]
these modifications on the method I mentioned seemed to work, but I am not sure
of its correctness, but hey it works :)
-(CCMenuItem *) itemForMouseEvent: (NSEvent *) event
{
CGPoint location = [(CCDirectorMac*)[CCDirector sharedDirector] convertEventToGL:event];
CCMenuItem* item;
CCARRAY_FOREACH(children_, item){
// ignore invisible and disabled items: issue #779 , #866
if ( [item visible] && [item isEnabled] ) {
//CGPoint local = [item convertToNodeSpace:location];
CGRect r = [item rect];
r = CGRectMake(r.origin.x * 2.0f, r.origin.y * 2.0f, r.size.width * 2.0f, r.size.height * 2.0f);
//r.origin = CGPointZero;
if( CGRectContainsPoint( r, location ) )
return item;
}
}
return nil;
}
Original comment by neves.jhenrique@gmail.com
on 27 Mar 2012 at 8:20
If I change the position of the CCMenu via an CCMoveTo action, the clickeable
area doesnt move along.
This should help:
r = CGRectMake((r.origin.x * CC_CONTENT_SCALE_FACTOR()) +
(item.parent.position.x * CC_CONTENT_SCALE_FACTOR()),
(r.origin.y * CC_CONTENT_SCALE_FACTOR()) + (item.parent.position.y * CC_CONTENT_SCALE_FACTOR()),
r.size.width * CC_CONTENT_SCALE_FACTOR(),
r.size.height * CC_CONTENT_SCALE_FACTOR());
Original comment by neves.jhenrique@gmail.com
on 27 Mar 2012 at 8:49
Original comment by ricardoq...@gmail.com
on 16 Apr 2012 at 11:05
Original issue reported on code.google.com by
neves.jhenrique@gmail.com
on 27 Mar 2012 at 6:49