So I've been playing around with the Particle3D sample provided on the site, and it is most awesome. There are a few things I would like to know:
1) Is there a way to control the order in which components are operated on? Example: I am currently calling a Draw function everything but the Particle Systems which are being drawn by the Components of the game. This causes my PS's to be drawn last, even over my text.
2) When I set Visible to false, and call the Draw(GameTime gameTime) function myself it doesn't draw. Am I missing something?
3) Lastly, if I enable multiple viewports with cameras how can I ensure that the PS's will be drawn in each viewport?
Here's a hierarchy for my game:
| Game.Update() |
| { |
| |
| tDelta = (float)(gameTime.ElapsedGameTime.TotalSeconds); |
| |
| GTime = gameTime; |
| |
| Input.Update(); |
| Audio.Update(); |
| UpdateLevel(); |
| CameraSystem.Update(); |
| base.Update(gameTime); |
| } |
| |
| protected override void Game.Draw(GameTime gameTime) |
| { |
| int numCameras = CameraSystem.ActiveCameras.Count; |
| |
| for (int i = 0; i < numCameras; ++i ) |
| { |
| |
| CameraSystem.CurrentCamera = CameraSystem.CameraList[CameraSystem.ActiveCameras[i]]; |
| Graphics.device.Viewport = CameraSystem.CurrentCamera.ViewPort; |
| Graphics.device.Clear(Color.CornflowerBlue); |
|
| |
| This.CurrentLevel.Draw(); |
| } |
| |
| base.Draw(gameTime); |
|
}
|
In my Level.Draw() I do call the PS's SetCamera method, just before I call the PS's Draw method
I have a sneaking suspicion that I am missing something small, but If you guys could help a fellow out it would be nice!