# CreateLineJoint

## Description

Creates a line joint between two sprites. The line joint allows the sprites to only move along a given axis relative to each other whilst rotating freely at either end. It is similar to a prismatic joint except that relative rotation is allowed.
Specify a single anchor point in world coordinates with the sprites already at the desired relative position, at the piston's minimal extent. From this point the sprites will be allowed to separate along the given axis relative to one another. The anchor point can be offset from the sprite center positions. A joint ID will be returned to reference this joint later, a joint may be deleted by the system if any of the sprites it connects are deleted. This joint supports motors and limits. Box2D has renamed this joint the Wheel Joint and it now contains a spring component to simulate a vehicle wheel. The AGK command name will remain the same for backwards compatibility, however the functionality may have changed

## Definition

integer CreateLineJoint( iSpriteIndex1, iSpriteIndex2, x, y, vx, vy, colConnected )

UINT agk::CreateLineJoint( UINT iSpriteIndex1, UINT iSpriteIndex2, float x, float y, float vx, float vy, int colConnected )

CreateLineJoint( iJointIndex, iSpriteIndex1, iSpriteIndex2, x, y, vx, vy, colConnected )

void agk::CreateLineJoint( UINT iJointIndex, UINT iSpriteIndex1, UINT iSpriteIndex2, float x, float y, float vx, float vy, int colConnected )

## Parameters

- iSpriteIndex1 - The ID of the first sprite to join.
- iSpriteIndex2 - The ID of the second sprite to join.
- x - The x coordinate of the anchor point.
- y - The y coordinate of the anchor point.
- vx - The x component of the axis.
- vy - The y component of the axis.
- colConnected - Set whether the two sprites connected by the joint can collide with one another, 0=no, 1=yes.
- iJointIndex - The ID to use for this joint.