Add FX to a viewport

Would it be possible to add the ability to add FX to a viewport? It would make things like screen shaking by applying a position FX to the viewport easier.

Comments

  • edited February 2012
    I'm pretty sure you'd want to to apply the shaking to the camera and not to the viewport or you'll end up with parts of your screen left undrawn. :)

    The easy way is to create a dummy object and set it as parent of the camera. Then instead of moving the camera, move that object.
    And you can also add FXs to it of course, for shakes or for smooth camera movements.
  • edited February 2012
    That's a better idea. Thanks!
    Now how do you set something as the parent of the camera?
  • edited February 2012
    If you have a pointer to the camera, simply call orxCamera_SetParent() on it.

    If you don't have it, you can either go through the camera list, or better, if you have more than one camera, you can get it from your viewport with orxViewport_GetCamera().
Sign In or Register to comment.