public void Render(SpriteBatch sb) { // It sorts based on the depth value provided. Back to front draws greatest depth to least depth. // Front to back draws least to greatest. It won't render right without this. sb.Begin(SpriteSortMode.FrontToBack, null, null, null, null, null, m_Transform.GetTransformation()); foreach (Components.IRenderable rend in m_Renderables) { rend.Render(sb); } sb.End(); }
/// <summary> /// Get the matrix which transforms a given world position into screen coordinates through PassID; /// </summary> /// <returns></returns> public static Matrix WorldToScreenMatrix(string PassID = "Unsorted") { ITransformer trans = XNAGame.Instance.GetBroadphase <Broadphases.Graphics>("Graphics").GetTransformer(PassID); return(trans.GetTransformation()); }