Why does Sprite created using ui->GetRoot()->CreateChild() renders on top of a Sprite created by new Sprite( context_ ) even though the new Sprite has higher priority?
My code sniplet:
m_pSplashScreen = new Sprite( context_ );
m_pSplashScreen->SetTexture( cache->GetResource<Texture2D>("Textures/black128.png") );
m_pSplashScreen->SetSize( graphics->GetWidth(), graphics->GetHeight() );
m_pSplashScreen->SetAlignment( HA_LEFT, VA_TOP );
m_pSplashScreen->SetPriority( 100 );
m_uiSplashTimerId = SDL_AddTimer( 3000, &Splash_TimerCallback, this );
Sprite *pSpriteBackground = ui->GetRoot()->CreateChild<Sprite>();
pSpriteBackground->SetTexture( cache->GetResource<Texture2D>("Textures/free-wallpaper-19.jpg") );
pSpriteBackground->SetSize( graphics->GetWidth(), graphics->GetHeight() );
pSpriteBackground->SetAlignment( HA_LEFT, VA_TOP );
pSpriteBackground->SetPriority( -200 );
And m_pSplashScreen is never seen, however, if I construct the m_pSplashScreen using the ui->GetRoot()->CreateChild() method, it becomes visible.
Not sure what’s going on. Any help would be appreciated.