|
Inkey questions
#222263
08/18/08 17:36
08/18/08 17:36
|
Joined: May 2007
Posts: 185 Netherlands
SurudoiRyu
OP
Member
|
OP
Member
Joined: May 2007
Posts: 185
Netherlands
|
Hi im using an inkey to put a playername in. But now im having a white box where the text must come in, And quest what.. the inkey text is aswell white... I tryed with vector my.blue and in the panel* blue green red but it looks like nothing is working to change the color of the inkey text. Aswell when i want to compare the text with a string it doesn't work. :S I dont know why but maybe there is a solution to go around this on another way ? here some of my code: Inkey code:
set(entry_txt,VISIBLE);
inkey(entry_str);
if (result == 13)
{
level_load ("testlvl.WMB");
wait(-1);
my = ent_create ("blueguard.mdl",vector(0,0,45),NULL);
reset(entry_txt,VISIBLE);
reset(Plogin,VISIBLE);
reset(messages_txt, VISIBLE);
set(txtChat, VISIBLE);
set(pSlotbars, VISIBLE);
Camera_Action();
Player_Action();
PlayerHUD();
}
/////////////////////////////
TEXT* entry_txt = // displays the playername put in
{
layer = 55;
pos_x = 10;
pos_y = 50;
layer = 10;
string (entry_str);
}
greetzzz,
-The Dragon's Eye is alway's watching you!-
|
|
|
Re: Inkey questions
[Re: Lukas]
#222281
08/18/08 18:45
08/18/08 18:45
|
Joined: May 2007
Posts: 185 Netherlands
SurudoiRyu
OP
Member
|
OP
Member
Joined: May 2007
Posts: 185
Netherlands
|
ok got now this:
TEXT* entry_txt = // displays the playername put in
{
font = "msgfont.pcx";
layer = 55;
pos_x = 10;
pos_y = 50;
layer = 10;
string (entry_str);
red = 255 ;
green = 5 ;
blue = 5 ;
}
but it is still white :S ? Can it because it is on another layer ? PANEL* Plogin = // displays the playername put in
{
layer = 50;
bmap = "bmp_login.tga";
pos_x = 10;
pos_y = 50;
layer = 10;
flags = TRANSLUCENT;
} greetzzz,
-The Dragon's Eye is alway's watching you!-
|
|
|
Re: Inkey questions
[Re: SurudoiRyu]
#222284
08/18/08 18:49
08/18/08 18:49
|
Joined: Apr 2004
Posts: 516 USA
Trooper119
User
|
User
Joined: Apr 2004
Posts: 516
USA
|
Why didn't you look in the manual? It gives the below example
text welcome // define Text object
{
// White Text
red = 255;
green = 255;
blue = 255;
font = arial_font;
string = "Welcome";
}
A clever person solves a problem. A wise person avoids it. --Einstein
Currently Codeing: Free Lite-C
|
|
|
Re: Inkey questions
[Re: MrGuest]
#222428
08/19/08 10:01
08/19/08 10:01
|
Joined: May 2007
Posts: 185 Netherlands
SurudoiRyu
OP
Member
|
OP
Member
Joined: May 2007
Posts: 185
Netherlands
|
Yes i used the template font. And its white... But the pcx is green. why is it white when the picture font is green?
i gonna try to make it red hope that it helps.
Aswell it looks like the inkey is behind the panel? but i defined it to be on top of the panel could it be cause i use a half transparant TGA ?
-The Dragon's Eye is alway's watching you!-
|
|
|
Re: Inkey questions
[Re: SurudoiRyu]
#222445
08/19/08 12:30
08/19/08 12:30
|
Joined: May 2007
Posts: 185 Netherlands
SurudoiRyu
OP
Member
|
OP
Member
Joined: May 2007
Posts: 185
Netherlands
|
solved it PANEL* Plogin = // displays the playername put in { layer = 50; bmap = "bmp_login.tga"; pos_x = 10; pos_y = 50; layer = 10; flags = TRANSLUCENT; } that was one problem >.< pretty stupid lol. Solved aswell the color of the font but now my other problem is to check if they are the same as another value Like my inkey is: /search and my check is to look if you put in /search or not with a STRING* search_str = "/search";
STRING* search_str = "/search";
function chat_entry()
{
// if host or client
if (connection == 2 || connection == 3)
{
// if inkey already open return
if (inkey_active) return;
str_cpy(strChatEntry, "#100");
set(txtChatEntry,VISIBLE);
inkey(strChatEntry); // get chat entry
// if entry was empty don't process
if(str_cmp(strChatEntry,""))
//if(str_len(strChatEntry)==0)
{
return;
}
reset(txtChatEntry,VISIBLE);
if(strChatEntry == search_str)
{
str_cpy(strSendChat,player_name); // put players name before entry
str_cat(strSendChat," searches his pockets. ");
}
else
{
str_cpy(strSendChat,player_name); // put players name before entry
str_cat(strSendChat,": ");
str_cat(strSendChat,strChatEntry);
}
// if Host go ahead and do chat manipulation
if (connection == 3)
{
send_string(strSendChat);
str_cpy(strChat0, strChat1);
str_cpy(strChat1, strChat2);
str_cpy(strChat2, strChat3);
str_cpy(strChat3, strChat4);
str_cpy(strChat4, strChat5);
str_cpy(strChat5, strChat6);
str_cpy(strChat6, strChat7);
str_cpy(strChat7, strChat8);
str_cpy(strChat8, strSendChat);
str_cpy(strSendChat,"");
}
else // if client send entry to server for processing
{
send_string(strSendChat);
}
str_cpy(strSendChat,"#100"); // clear the strings for client and
str_cpy(strChatEntry,"#100"); // server called functions
}
}
greetzzz,
Last edited by SurudoiRyu; 08/19/08 12:31.
-The Dragon's Eye is alway's watching you!-
|
|
|
Re: Inkey questions
[Re: SurudoiRyu]
#222544
08/19/08 21:39
08/19/08 21:39
|
Joined: Nov 2007
Posts: 1,143 United Kingdom
DJBMASTER
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,143
United Kingdom
|
Hi Ryu, i literally came up with this minutes after you left MSN...
STRING* temp_string = " "; // temp string for inkey
STRING* my_keyword = "/search"; // your chosen search word
function compare_string()
{
if(inkey(temp_string)!=1)
{
if(str_cmp(temp_string,my_keyword)==1){beep(); beep();}
}
}
This will compare what you enter using the keyboard with a predefined string. If it matches, the engine will beep twice. Mod it to your purposes...David
Last edited by DJBMASTER; 08/19/08 21:41.
|
|
|
|