Show / Hide Table of Contents

    Interface IRoomTransition

    This interface allows you to create custom room transitions, to build all kinds of special effects when transitioning from room to room.

    Namespace: AGS.API
    Assembly: AGS.API.dll
    Syntax
    public interface IRoomTransition

    Methods

    | Improve this Doc View Source

    RenderAfterEnteringRoom(List<IObject>)

    Will be called repeatedly after entering the new room, up until this function will return false. Once this function returns false, room rendering returns to AGS for a normal rendering loop (the transition is completed).

    Declaration
    bool RenderAfterEnteringRoom(List<IObject> displayList)
    Parameters
    Type Name Description
    System.Collections.Generic.List<IObject> displayList

    The display list of the room we are leaving. The display list contains all objects that are rendered in the scene, sorted by their order.

    Returns
    Type Description
    System.Boolean

    true, if we still want control, false otherwise.

    | Improve this Doc View Source

    RenderBeforeLeavingRoom(List<IObject>)

    Will be called repeatedly before leaving the first room, up until this function will return false.

    Declaration
    bool RenderBeforeLeavingRoom(List<IObject> displayList)
    Parameters
    Type Name Description
    System.Collections.Generic.List<IObject> displayList

    The display list of the room we are leaving. The display list contains all objects that are rendered in the scene, sorted by their order.

    Returns
    Type Description
    System.Boolean

    true, if we still want control, false otherwise.

    | Improve this Doc View Source

    RenderTransition(IFrameBuffer, IFrameBuffer)

    Will be called repeatedly during the rooms transition, up until this function will return false.

    Declaration
    bool RenderTransition(IFrameBuffer from, IFrameBuffer to)
    Parameters
    Type Name Description
    IFrameBuffer from

    A screenshot of the room that we are leaving.

    IFrameBuffer to

    A screenshot of the room that we entering into.

    Returns
    Type Description
    System.Boolean

    true, if we still want control, false otherwise.

    Examples

    Let's render the "old" screenshot with half opacity over the "new" screenshot:

    QuadVectors _screenVectors = new QuadVectors(AGSGame.Game); //will create a quad covering the entire screen
    
    public bool RenderTransition(IFrameBuffer from, IFrameBuffer to)
    {
        _screenVectors.Render(to.Texture);
        _screenVectors.Render(from.Texture, a: 0.5f);
    
        return true; //Note that this room transition will never end if we always return true, at some point we need to return false...
    }
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX