public override void Initialize() { //DebugSystem.Initialize(Game, "fonts/debugfont"); //DebugSystem.Instance.FpsCounter.Visible = true; //DebugSystem.Instance.TimeRuler.Visible = true; //DebugSystem.Instance.TimeRuler.ShowLog = true; s_pSharedApplication = this; InitInstance(); base.Initialize(); }
/// <summary> /// Intializes with a texture2d with data /// </summary> public bool InitWithData(object data, CCTexture2DPixelFormat pixelFormat, uint pixelsWide, uint pixelsHigh, CCSize contentSize) { CCApplication app = CCApplication.SharedApplication; Texture = new Texture2D(app.GraphicsDevice, (int)contentSize.Width, (int)contentSize.Height); m_tContentSize = contentSize; m_uPixelsWide = (int)pixelsWide; m_uPixelsHigh = (int)pixelsHigh; m_ePixelFormat = pixelFormat; m_fMaxS = contentSize.Width / (pixelsWide); m_fMaxT = contentSize.Height / (pixelsHigh); m_bHasPremultipliedAlpha = false; //m_bHasMipmaps = false; return(true); }
public override void OnEnter() { if (!m_bDidInit) { Init(); } // register 'parent' nodes first // since events are propagated in reverse order if (m_bIsMultiTouchEnabled || m_bIsSingleTouchEnabled) { RegisterWithTouchDispatcher(); } // then iterate over all the children base.OnEnter(); CCDirector director = CCDirector.SharedDirector; CCApplication application = CCApplication.SharedApplication; // add this layer to concern the Accelerometer Sensor if (m_bIsAccelerometerEnabled) { #if !PSM && !NETFX_CORE director.Accelerometer.SetDelegate(this); #endif } // add this layer to concern the kaypad msg if (m_bKeypadEnabled) { director.KeypadDispatcher.AddDelegate(this); } if (GamePadEnabled && director.GamePadEnabled) { application.GamePadButtonUpdate += m_OnGamePadButtonUpdateDelegate; application.GamePadConnectionUpdate += m_OnGamePadConnectionUpdateDelegate; application.GamePadDPadUpdate += m_OnGamePadDPadUpdateDelegate; application.GamePadStickUpdate += m_OnGamePadStickUpdateDelegate; application.GamePadTriggerUpdate += m_OnGamePadTriggerUpdateDelegate; } }
public override void OnEnter() { if (!m_bDidInit) { Init(); } // then iterate over all the children base.OnEnter(); CCDirector director = CCDirector.SharedDirector; CCApplication application = CCApplication.SharedApplication; // add this layer to concern the Accelerometer Sensor if (m_bIsAccelerometerEnabled) { #if !PSM && !NETFX_CORE director.Accelerometer.SetDelegate(this); #endif } }
public override void Initialize() { s_pSharedApplication = this; InitInstance(); base.Initialize(); }