Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, TedMar, dr_panther, Ayumi), 1,072 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Inkey questions #222263
08/18/08 17:36
08/18/08 17:36
Joined: May 2007
Posts: 185
Netherlands
SurudoiRyu Offline OP
Member
SurudoiRyu  Offline 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:
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: SurudoiRyu] #222264
08/18/08 17:42
08/18/08 17:42
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
You did not choose a font in your TEXT*, so the default font is used, which is always white.

TEXT* entry_txt =
{
...
font = your_font;
...
red = ... ;
green = ... ;
blue = ... ;
...
}

Re: Inkey questions [Re: Lukas] #222281
08/18/08 18:45
08/18/08 18:45
Joined: May 2007
Posts: 185
Netherlands
SurudoiRyu Offline OP
Member
SurudoiRyu  Offline OP
Member

Joined: May 2007
Posts: 185
Netherlands
ok got now this:

Code:
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 ?

Code:
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 Offline
User
Trooper119  Offline
User

Joined: Apr 2004
Posts: 516
USA
Why didn't you look in the manual? It gives the below example

Code:
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: SurudoiRyu] #222287
08/18/08 18:55
08/18/08 18:55
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
font = "msgfont.pcx";
This is a bitmap font. The colour of this font can't be changed by script, that is only possible with truetype fonts. Actually, if that is the msgfont.pcx from the templates, the text is GREEN.
Anyway, if you use a bitmap font and want to change the colour, open it with a graphic editor and change the colour.

EDIT: I think I wrote too slow laugh

Last edited by Lukas; 08/18/08 18:56.
Re: Inkey questions [Re: Trooper119] #222301
08/18/08 19:39
08/18/08 19:39
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
afaik you can't change the inkey string colour without editing the image

Re: Inkey questions [Re: MrGuest] #222428
08/19/08 10:01
08/19/08 10:01
Joined: May 2007
Posts: 185
Netherlands
SurudoiRyu Offline OP
Member
SurudoiRyu  Offline 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 Offline OP
Member
SurudoiRyu  Offline OP
Member

Joined: May 2007
Posts: 185
Netherlands
solved it smile

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";

Code:
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 Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Hi Ryu, i literally came up with this minutes after you left MSN...

Code:

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.
Re: Inkey questions [Re: DJBMASTER] #231206
10/12/08 20:44
10/12/08 20:44
Joined: Aug 2008
Posts: 61
Neurosys Offline
Junior Member
Neurosys  Offline
Junior Member

Joined: Aug 2008
Posts: 61
um... trying to use this inkey in c++ w/ SDK .... inkey isnt a known identifier... wth? no inkey for c++ guys


See more code and crap @ www.neuroticnetworks.com
Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1