43429members
217967posts

Citect Cicode Function DspAnGetPos

Highlighted
Ensign

Citect Cicode Function DspAnGetPos

Hi,

 

(Citect Version: v8.10.0.2086)

Why does this function return the position of the bottom left corner of the animation object relative to the top left corner of the window?

There is nothing in the manual stating that this is how the function works.

Shouldn't this function return the top left corner of the animation object?

 

2 REPLIES 2
Highlighted
Lieutenant JG

Re: Citect Cicode Function DspAnGetPos

The animation point is just a point so it has no top or bottom.

 

If an object or genie is being displayed at that point then obviously it does have a top and bottom but this can be offset anywhere from the animation point itself. For example, when you create a genie the animation point for it can be positioned top-left, bottom left or 143 pixels away.

 

You would have to look at the object itself to see where the animation point is positioned.

 

 

 

Highlighted
Lieutenant JG

Re: Citect Cicode Function DspAnGetPos

Additional to Richard's comments, the DspAnGetPos() function returns the X and Y position of the animation point in question, relative to the top-left corner of the window (remember multiple screens can be present).

 

Every object on a Citect page has an Animation Point and some objects can have many depending upon whether multiple objects have been grouped into a single object etc..  This function is one of the few functions within Citect that returns both X and Y positions at the same time.

 

Example:

 

FUNCTION AnXYPos(INT hAn)
INT iXPos;
INT iYpos;

DspAnGetPos(hAn, iXpos, iYpos);

 

When the function is run iXpos & iYpos will contain the X, Y coordinates to the AN passed 

 

Regards

 

Rob