GXSceneFollowEntity - boxgaming/gx GitHub Wiki

Keep the scene positioned relative to a specified entity.

Syntax

GXSceneFollowEntity entityId%, followMode%

Parameters

  • Entity to follow is specified by the entityId% parameter. This id is returned by the GXEntityCreate function or can be accessed by its user id by the GX function.
  • The followMode% parameter specifies the method the engine should use to follow the specified entity.

Scene Follow Modes

Mode Description
GXSCENE_FOLLOW_NONE No automatic scene positioning (default)
GXSCENE_FOLLOW_ENTITY_CENTER Center the view on a specified entity
GXSCENE_FOLLOW_ENTITY_CENTER_X Center the x axis of the scene on the specified entity
GXSCENE_FOLLOW_ENTITY_CENTER_Y Center the y axis of the scene on the specified entity
GXSCENE_FOLLOW_ENTITY_CENTER_X_POS Center the x axis of the scene only when moving to the right
GXSCENE_FOLLOW_ENTITY_CENTER_X_NEG center the x axis of the scene only when moving to the left

Examples

Example1: Keep the scene centered on a specified entity.

GXSceneCreate 320, 180

DIM SHARED warhog AS LONG
warhog = GXEntityCreate("img/warhog.png", 16, 16, 5)

GXSceneFollowEntity warhog, GXSCENE_FOLLOW_ENTITY_CENTER

See Also

GXSceneCreate GX