draw_obj(void* ptr)

Schreibt ein gelayertes Objekt - ein Textpanel oder eine View-Entity - im gegenwärtigen Frame auf den Bildschirm. A7.81 LC

Parameter:

ptr TEXT*, PANEL*, oder View-ENTITY*-Pointer, der gezeichnet werden soll.

Bemerkungen:

Geschwindigkeit:

Mittel

Beispiel (lite-C):

// TEXT object to hold the player name
TEXT* txtPlayerName =
{
   strings = 1;
   flags = CENTER_X;
   font = "Arial#13bi";
}

// Display the entities' string1 above its head
// Call this function in the entities' while loop
function show_my_name()
{
  VECTOR* vTextpos = vector(my.x,my.y,my.z+my.max_z+5); // 5 quants above head
  vec_to_screen(vTextpos,camera);   // convert to screen coordinates
  txtPlayerName.pos_x = vTextpos.x; // set the position
  txtPlayerName.pos_y = vTextpos.y;
  str_cpy((txtPlayerName.pstring)[0],my.string1); // set the TEXT string
  draw_obj(txtPlayerName);
}

Siehe auch:

draw_text, TEXT, PANEL, ENTITY

► latest version online