When you have a flipbook called 'objectives' (which can hold all objective pictures you can have) then you can draw any picture from this flipbook at any point on the screen anytime you like.
It doesn't matter where in space the flipbook entity is, because the DrawFlipBookImage method just looks at the flipbook as a collection of images, it only sees the raw files, objectives0.bmp, objectives1.bmp... The number after the 'main word' it gets from the variable 'int ImageIndex'. So
DrawFlipbookImage("objective", X, 0, 0, 200, 255, 255, 255, 0 );
would draw the image number X from the "objective" FlipBook entity.
It also only renders them one time, in the current frame. You can't switch it 'on' and 'off'. You either render it or not.
The GetEntityScreenX and GetEntityScreenY are needed because you have to somehow get where the 'objective pawn' is and then draw the picture there (remember that the place of the flipbook entity does not make any difference?) Then for example you would write:
Code: Select all
if(GetEventState("objective1")=true)
{
SCREENX=GetEntityScreenX("ObjectivePawn");
SCREENY=GetEntityScreenY("ObjectivePawn");
FLIPBOOKNUMBER=0;
DrawFlipbookImage("objective", FLIPBOOKNUMBER, SCREENX, SCREENY, 200, 255, 255, 255, 0 );
}
And when you are finished you set the state of the objective to false.
SetEventState("objective1",false);
One thing with the GetEntityScreen commands is that they seem to have problems recognizing if the entity you ask for is on screen or 'behind' it.
Everyone can see the difficult, but only the wise can see the simple.
-----