コード例 #1
0
ファイル: CCDirector.cs プロジェクト: pekayatt/cocos2d-xna
        public virtual bool Init()
        {
            // scenes
            m_pRunningScene = null;
            m_pNextScene    = null;

            m_pNotificationNode = null;

            m_dOldAnimationInterval = m_dAnimationInterval = 1.0 / kDefaultFPS;

            // Set default projection (3D)
            m_eProjection = CCDirectorProjection.Default;

            // projection delegate if "Custom" projection is used
            m_pProjectionDelegate = null;

            // FPS
            m_fAccumDt      = 0.0f;
            m_fFrameRate    = 0.0f;
            m_pFPSLabel     = null;
            m_pSPFLabel     = null;
            m_pDrawsLabel   = null;
            m_bDisplayStats = false;
            m_uTotalFrames  = m_uFrames = 0;

            // paused ?
            m_bPaused = false;

            // purge ?
            m_bPurgeDirecotorInNextLoop = false;

            m_obWinSizeInPixels = m_obWinSizeInPoints = CCSize.Zero;

            //m_pobOpenGLView = null;

            m_fContentScaleFactor = 1.0f;

            // scheduler
            m_pScheduler = new CCScheduler();
            // action manager
            m_pActionManager = new CCActionManager();
            m_pScheduler.ScheduleUpdateForTarget(m_pActionManager, CCScheduler.kCCPrioritySystem, false);
            // touchDispatcher
            m_pTouchDispatcher = new CCTouchDispatcher();
            m_pTouchDispatcher.Init();

            // KeypadDispatcher
            m_pKeypadDispatcher = new CCKeypadDispatcher();

            // Accelerometer
#if !PSM && !NETFX_CORE
            m_pAccelerometer = new CCAccelerometer();
#endif
            // create autorelease pool
            //CCPoolManager::sharedPoolManager()->push();

            m_NeedsInit = false;
            return(true);
        }
コード例 #2
0
 public CCTimer(CCScheduler scheduler, SelectorProtocol target, SEL_SCHEDULE selector, float seconds, uint repeat, float delay)
 {
     _scheduler = scheduler;
     Target = target;
     Selector = selector;
     Elapsed = -1;
     OriginalInterval = seconds;
     Interval = seconds;
     m_fDelay = delay;
     m_bUseDelay = delay > 0f;
     m_nRepeat = repeat;
     m_bRunForever = m_nRepeat == uint.MaxValue;
 }
コード例 #3
0
 public CCTimer(CCScheduler scheduler, SelectorProtocol target, SEL_SCHEDULE selector, float seconds, uint repeat, float delay)
 {
     _scheduler       = scheduler;
     Target           = target;
     Selector         = selector;
     Elapsed          = -1;
     OriginalInterval = seconds;
     Interval         = seconds;
     m_fDelay         = delay;
     m_bUseDelay      = delay > 0f;
     m_nRepeat        = repeat;
     m_bRunForever    = m_nRepeat == uint.MaxValue;
 }
コード例 #4
0
ファイル: CCScheduler.cs プロジェクト: rtabbara/cocos2d-xna
 public CCTimer(CCScheduler scheduler, ICCSelectorProtocol target, Action<float> selector, float seconds,
                uint repeat, float delay)
 {
     _scheduler = scheduler;
     m_pTarget = target;
     Selector = selector;
     m_fElapsed = -1;
     OriginalInterval = seconds;
     Interval = seconds;
     m_fDelay = delay;
     m_bUseDelay = delay > 0f;
     m_uRepeat = repeat;
     m_bRunForever = m_uRepeat == uint.MaxValue;
 }
コード例 #5
0
ファイル: CCScheduler.cs プロジェクト: krashman/cocos2d-xna
 public CCTimer(CCScheduler scheduler, ICCSelectorProtocol target, Action <float> selector, float seconds,
                uint repeat, float delay)
 {
     _scheduler       = scheduler;
     m_pTarget        = target;
     Selector         = selector;
     m_fElapsed       = -1;
     OriginalInterval = seconds;
     Interval         = seconds;
     m_fDelay         = delay;
     m_bUseDelay      = delay > 0f;
     m_uRepeat        = repeat;
     m_bRunForever    = (m_uRepeat == CCScheduler.kCCRepeatForever);
 }
コード例 #6
0
        public CCNode()
        {
            m_fScaleX  = 1.0f;
            m_fScaleY  = 1.0f;
            m_bVisible = true;
            m_nTag     = kCCNodeTagInvalid;

            m_sTransform    = CCAffineTransform.Identity;
            m_bInverseDirty = true;

            // set default scheduler and actionManager
            CCDirector director = CCDirector.SharedDirector;

            m_pActionManager = director.ActionManager;
            m_pScheduler     = director.Scheduler;
        }
コード例 #7
0
ファイル: CCDirector.cs プロジェクト: netonjm/cocos2d-xna
        public virtual bool Init()
        {
            SetDefaultValues();

            // scenes
            m_pRunningScene = null;
            m_pNextScene = null;

            m_pNotificationNode = null;

            m_dOldAnimationInterval = m_dAnimationInterval = 1.0 / kDefaultFPS;

            // Set default projection (3D)
            m_eProjection = CCDirectorProjection.Default;

            // projection delegate if "Custom" projection is used
            m_pProjectionDelegate = null;

            // FPS
            m_fAccumDt = 0.0f;
            m_pFPSLabel = null;
            m_pUpdateTimeLabel = null;
            m_pDrawTimeLabel = null;
            m_pDrawsLabel = null;
            m_bDisplayStats = false;
            m_uTotalFrames = 0;

            m_pStopwatch = new Stopwatch();

            // paused ?
            m_bPaused = false;

            // purge ?
            m_bPurgeDirecotorInNextLoop = false;

            m_obWinSizeInPoints = CCSize.Zero;

            //m_pobOpenGLView = null;

            m_fContentScaleFactor = 1.0f;

            // scheduler
            m_pScheduler = new CCScheduler();
            // action manager
            m_pActionManager = new CCActionManager();
            m_pScheduler.ScheduleUpdateForTarget(m_pActionManager, CCScheduler.kCCPrioritySystem, false);
            // touchDispatcher
            m_pTouchDispatcher = new CCTouchDispatcher();
            m_pTouchDispatcher.Init();

            // KeypadDispatcher
            m_pKeypadDispatcher = new CCKeypadDispatcher();

			// KeyboardDispatcher
			m_pKeyboardDispatcher = new CCKeyboardDispatcher();

			// Accelerometer
#if !PSM &&!NETFX_CORE
            m_pAccelerometer = new CCAccelerometer();
#endif
            // create autorelease pool
            //CCPoolManager::sharedPoolManager()->push();

            m_NeedsInit = false;
            return true;
        }
コード例 #8
0
ファイル: CCNode.cs プロジェクト: CartBlanche/cocos2d-xna
        public CCNode()
        {
            m_fScaleX = 1.0f;
            m_fScaleY = 1.0f;
            m_bIsVisible = true;
            m_nTag = kCCNodeTagInvalid;

            m_tTransform = CCAffineTransform.Identity;
            m_bIsInverseDirty = true;

            // set default scheduler and actionManager
            CCDirector director = CCDirector.SharedDirector;
            m_pActionManager = director.ActionManager;
            m_pScheduler = director.Scheduler;
        }
コード例 #9
0
ファイル: CCScheduler.cs プロジェクト: rtabbara/cocos2d-xna
        /** Initializes a timer with a target, a selector and an interval in seconds. 
         *  Target is not needed in c#, it is just for compatibility.
         */

        public CCTimer(CCScheduler scheduler, ICCSelectorProtocol target, Action<float> selector, float seconds)
            : this(scheduler, target, selector, seconds, 0, 0)
        {
        }
コード例 #10
0
        /** Initializes a timer with a target, a selector and an interval in seconds. 
         *  Target is not needed in c#, it is just for compatibility.
         */

        public CCTimer(CCScheduler scheduler, SelectorProtocol target, SEL_SCHEDULE selector, float seconds)
            : this(scheduler, target, selector, seconds, 0, 0)
        {
        }
コード例 #11
0
        /** Initializes a timer with a target, a selector and an interval in seconds.
         *  Target is not needed in c#, it is just for compatibility.
         */

        public CCTimer(CCScheduler scheduler, SelectorProtocol target, SEL_SCHEDULE selector, float seconds)
            : this(scheduler, target, selector, seconds, 0, 0)
        {
        }
コード例 #12
0
ファイル: CCScheduler.cs プロジェクト: krashman/cocos2d-xna
        /** Initializes a timer with a target, a selector and an interval in seconds.
         *  Target is not needed in c#, it is just for compatibility.
         */

        public CCTimer(CCScheduler scheduler, ICCSelectorProtocol target, Action <float> selector, float seconds)
            : this(scheduler, target, selector, seconds, 0, 0)
        {
        }