Show / Hide Table of Contents

    Interface ICamera

    The camera is a script that is executed each game tick, and manipulates the viewport.

    The default camera tracks the target (usually the player) by slowly moving the viewport (in a smooth transition) so the target is at the center, while also adjusting the zoom if the target is standing in a IZoomArea.

    You can however implement your own camera, where each room can have a different camera if desired.

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

    Properties

    | Improve this Doc View Source

    Enabled

    Gets or sets a value indicating whether this ICamera is enabled. If the camera is disabled then the viewport will not be updated by the camera, you can still update the viewport manually. If the camera is enabled and you attempt to set the viewport manually, the camera (depending on the implementation, but this is true for the default camera) will slowly change the viewport to center the target.

    Declaration
    bool Enabled { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if enabled; otherwise, false.

    | Improve this Doc View Source

    Target

    Gets or sets the target which the camera will be following.

    Declaration
    Func<IObject> Target { get; set; }
    Property Value
    Type Description
    System.Func<IObject>

    The target.

    Methods

    | Improve this Doc View Source

    Tick(IViewport, RectangleF, Size, Boolean)

    Executes the next tick. This is called on each tick by the engine, you don't need to call it yourself.

    Declaration
    void Tick(IViewport viewport, RectangleF roomLimits, Size virtualResolution, bool resetPosition)
    Parameters
    Type Name Description
    IViewport viewport

    The viewport to manipulate.

    RectangleF roomLimits

    Room limits, as provided by IRoomLimitsProvider.

    Size virtualResolution

    The game's virtual resolution.

    System.Boolean resetPosition

    If set to true reset position, i.e the camera will not do a smooth transition, but go straight to the target destination.

    • Improve this Doc
    • View Source
    Back to top Generated by DocFX