AGK for Pascal
ContentsIndexHome
PreviousUpNext
TAgkMouseJoint.Create Constructor (TAgkObject, TAgkSprite, Single, Single, Single)

Creates a mouse joint between a point and a sprite. This is typically used when dragging a shape with the mouse pointer, and attempts to move the sprite towards the given point using a force up to the maximum given.

Syntax
Pascal
constructor Create(const Owner: TAgkObject; const Sprite: TAgkSprite; const X: Single; const Y: Single; const MaxForce: Single); overload;
Parameters 
Description 
const Owner: TAgkObject 
the owner of the new joint (eg. a TAgkScene object). 
const Sprite: TAgkSprite 
The sprite to move. 
const X: Single 
The X coordinate of the initial anchor point on the sprite. 
const Y: Single 
The Y coordinate of the initial anchor point on the sprite. 
const MaxForce: Single 
The maximum force the joint can use to move the sprite. 

Specify an anchor point in world coordinates that will act as the initial hold point on the sprite. Any further change in the target position will attempt to move that point of the sprite to the new location. Use SetTarget to change the location of the target position. 

TAgkMouseJoint

Copyright (c) 2012. All rights reserved.