Alex,
Here is some code I think should work. It's an advance from the original concept as that code need some work.
firstly you need to make the hud object seperately.
dbMakeObjectPlain(1,dbScreenWidth(),dbScreenHeight());
I have created a function to position the hud plain.
void PositionHudObject(int obj,int x,int y) {
float cameraFOV=61.9621391296;
float zDist=((float)dbScreenHeight()/2)/dbTan((float)cameraFOV/2);
int BaseX=0-dbScreenWidth()/2;
int BaseY=dbScreenHeight()/2;
float cpx=dbCameraPositionX();
float cpy=dbCameraPositionY();
float cpz=dbCameraPositionZ();
//dbMakeObjectPlain(obj,width,height);
dbPositionObject(obj,cpx,cpy,cpz);
dbSetObjectToCameraOrientation(obj);
dbTurnObjectLeft(obj,180);
dbMoveObject(obj,zDist*-1);
dbMoveObjectLeft(obj,BaseX+x+(dbObjectSizeX(obj)/2));
dbMoveObjectUp(obj,BaseY-y-(dbObjectSizeY(obj)/2));
dbDisableObjectZDepth(obj);
dbSetObjectFilter(obj,0);
dbSetObjectLight(obj,0);
dbSetObjectTransparency(obj,1);
}
Then in you main loop just call the position code to ensure the plain remains lined up correctly.
while ( LoopGDK ( ) )
{
PositionHudObject(1,0,0);
// here we make a call to update the contents of the screen
dbSync ( );
}
Hope that makes sense.