you want to make a console in your 3d Gamestudio Project ?

here it is !

Code:
#include <acknex.h>


///////////////////////////////

STRING* input_c = "#80"; 

STRING* text_a = "testa";
STRING* text_b = "testb";

//BMAP* arrow = "cursor.png";


////////////////////////////////////////////////////////////////////



TEXT* def_ctxt = 
{ 
 string("Befehl: ",input_c); 
 layer = 999; 
}

TEXT* show_txt = 
{ 
pos_x = 400;
pos_y = 10;
flags = SHOW;
layer = 999; 
}

////////////////////////////////////////////////////////////////////


function create_console()
{   

  toggle (def_ctxt,SHOW);

  def_ctxt.pos_x = 410;
  def_ctxt.pos_y = 120;
  
  while is(def_ctxt ,SHOW) 
 {	
  inkey((def_ctxt ->pstring)[1]); // write ... 
  
  //input a //
  if (str_cmp(input_c,text_a))    
  {
   (show_txt.pstring)[0] = "Input A Okey";
  }
  else
  //input b //
  if (str_cmp(input_c,text_b))    
  {
   (show_txt.pstring)[0] = "Input B Okey";
  }
  
  else 
  {
   (show_txt.pstring)[0] = "Error";
  }
   
  wait(-2);
   
  str_cpy(input_c,"                                               ");  
  (show_txt.pstring)[0] = "       ";
 }  
}

/////////////////////////////////////////

function main()
{
  vec_set(screen_size,vector(1600,768,0)); // FENSTERGRÖSSE
  vec_set(screen_color,vector(50,1,1)); 
  vec_set(sky_color,vector(50,1,1)); 
  video_window(NULL,NULL,0,"Console");
  
  d3d_antialias = 1;
  shadow_stencil = 3;
  video_mode = 8;                         // Auflösung
  
 // mouse_map = arrow;
 // mouse_mode = 4;
  
  level_load(NULL);
  
  create_console();
  
}



write testa
or
wrtie testb



do you like it ?

Last edited by ratz; 11/20/15 14:19.