XNA Creators Club Online
Page 1 of 1 (2 items)
Sort Posts: Previous Next

Particle3D Sample on Multi screens

Last post 8/13/2008 4:03 PM by Chris Gay1. 1 replies.
  • 8/13/2008 3:42 PM

    Particle3D Sample on Multi screens

    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!

  • 8/13/2008 4:03 PM In reply to

    Re: Particle3D Sample on Multi screens

    Hey guys thanks for any time you might've already spent, but I figured it out!  I moved my base.Draw() in Game.Draw(GameTime gameTime) into the for loop for the cameras.  Gosh I feel silly.  And to think I've only spent the last 3 weeks on it....  I also found the DrawOrder and UpdateOrder Properties, duh.  For safety, I'm going to assume that 0 for both of these is first (i.e. sorted by lessthan)?  Thanks!
Page 1 of 1 (2 items) Previous Next