Originally discussed in this thread

The manual states that draw_obj is able to render view-entities. However, I'm unable to get that to work!

Here's the example code from the above thread. You'll need to provide your own "dummy.bmp":

Code:
PANEL* atestpanel = {
	flags=LIGHT;
	size_x = 50;
	size_y = 50;
	red = 200;
	green = 100;
	blue = 20;
}

ENTITY* atestent = {
	type="dummy.bmp";
	pan = 180;
	x = 200;
}

function main() {
	video_set(800,600,0,2);
	set(atestpanel,SHOW);
	atestent.flags2|=SHOW;
	while(!key_space) { 
		draw_text("Showing Originals",1,570,vector(255,255,255));
		wait(1);
	}
	while(key_space) wait(1);
	reset(atestpanel,SHOW);
	atestent.flags2&=~SHOW;
	while(1) {

		if(key_space) {
			atestpanel.pos_x = 30; //So we should have two panels shown
			draw_obj(atestpanel);
			atestpanel.pos_x = 100;
			draw_obj(atestpanel);

			atestent.z = 50;	//So we should have two entities shown
			draw_obj(atestent);
			atestent.z = 0;
			draw_obj(atestent);
		}
		
		draw_text("Using draw_obj when you press [SPACE].",1,570,vector(255,255,255));
		wait(1);
	}	
}



I'll quote myself from the other thread:

Quote:


This little test project displays a testpanel (orange) and a testentity ("dummy.bmp"). Sweet. This should convince you that the settings of the entity are not at fault.
Now, if you hit space, we get to the interesting part.

Here, draw_obj is used (as long as the spacebar is pressed) to draw two panels and two entities, in theory. The manual explicitly states:
Quote:

The SHOW flag of the object needs not be set.




So I reset the SHOW-flag.
As you can see, two panels are correctly rendered. Neat!
However, as you can also see, the entity is not shown.
For the curious, setting the entities' SHOW-flag won't help with draw_obj - it still won't be rendered (though you will see the entity at the last set position, obviously, but that's not due to draw_obj).


It seems then that draw_obj does not work for view entities, contrary to what the manual states. This, however, seems like a really useful function - it'd be great if we could use it like this!

If I misunderstood something or this is a fault in my code, my apologies.

Thanks in advance!


Perhaps this post will get me points for originality at least.

Check out Dungeon Deities! It's amazing and will make you happy, successful and almost certainly more attractive! It might be true!