Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
4 registered members (AndrewAMD, fogman, Grant, juanex), 972 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Capture and Display Text #276393
07/04/09 21:07
07/04/09 21:07
Joined: Sep 2006
Posts: 9
D
drwho Offline OP
Newbie
drwho  Offline OP
Newbie
D

Joined: Sep 2006
Posts: 9
Hi guys, I have a problem, I'm doing a menu where I want to put a input text and then display on the screen, read the manual that inkey has to use and str_cursor but I'm not getting, can someone help me please

Re: Capture and Display Text [Re: drwho] #276413
07/04/09 22:51
07/04/09 22:51
Joined: Aug 2005
Posts: 512
Bayern
Schmerzmittel Offline
User
Schmerzmittel  Offline
User

Joined: Aug 2005
Posts: 512
Bayern
What would you like exactly?

Please give some more infos for what the text should be.
Like:
Players name
Highscorename etc.


A7 Com V7.80
Re: Capture and Display Text [Re: Schmerzmittel] #276432
07/05/09 00:40
07/05/09 00:40
Joined: Sep 2006
Posts: 9
D
drwho Offline OP
Newbie
drwho  Offline OP
Newbie
D

Joined: Sep 2006
Posts: 9

I want to hold something on the screen I type some text and then I type it appears on the screen what I typed, I tried using the example of AUM62 but tried to adapt for lite-c, but it appears not only the number zero on the screen and nothing happens

This is the code I'm using

////////////////////////////////////////////////////////////////////
#include <acknex.h>
#include <default.c>

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

STRING* my_str = " ";
var cursor_pos;


PANEL* my_pan=

{

pos_x = 0;

pos_y = 0;

layer = 1;

digits (150, 300, 2, *, 1, cursor_pos);

flags = VISIBLE;

}


TEXT* my_txt =

{

pos_x = 300;
pos_y = 10;
layer = 2;
string (my_str);
flags = VISIBLE ;

}


function edit_text()

{

if (inkey_active == VISIBLE)
{
return;
} // don't react if the player presses the "E" key several times

my_txt.flags = VISIBLE ; // display the text

str_cpy (my_str, ""); // reset the string

while (str_cmpi(my_str, "") == 1) // make sure that the player has typed something in

{

inkey(my_str); // show the cursor -> store the input in my_str

wait (1);

}

}

function track_cursor()

{

while (1)

{

cursor_pos = str_cursor(my_str);

wait (1);

}

}

on_e = edit_text;

////////////////////////////////////////////////////////////////////
function main()
{
track_cursor();
video_mode = 7;
screen_color.blue = 150;

}

Last edited by drwho; 07/05/09 04:50.
Re: Capture and Display Text [Re: drwho] #276449
07/05/09 04:53
07/05/09 04:53
Joined: Sep 2006
Posts: 9
D
drwho Offline OP
Newbie
drwho  Offline OP
Newbie
D

Joined: Sep 2006
Posts: 9

I want to wait a cursor on the screen I type a word and then show what was typed, it is something simple just to learn how to capture a text and then print the screen, thank´s for your attention, the way sorry for my English smirk

Re: Capture and Display Text [Re: drwho] #276586
07/05/09 18:00
07/05/09 18:00
Joined: Sep 2006
Posts: 9
D
drwho Offline OP
Newbie
drwho  Offline OP
Newbie
D

Joined: Sep 2006
Posts: 9
Hi staff cool , I managed to settle in and got what I wanted, but is a simple program ,it is for me to learn how to program and how things in 3DGS, i thank for attention and hope help in following questions, thanks laugh


follows the code:-

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

////////////////////////////////////////////////////////////////////
#include <acknex.h>
#include <default.c>

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



var cursor_pos;



STRING* my_str = "#20"; // allow up to 20 characters



PANEL* my_pan =

{
pos_x = 0;
pos_y = 0;
layer = 0;
flags = VISIBLE;
}

TEXT* my_txt =
{
pos_x = 100;
pos_y = 250;
layer = 1;
string (my_str);
flags = VISIBLE;
}



function edit_text()

{

str_cpy (my_str, "");
{
inkey(my_str);
wait (1);
}

}

function track_cursor()
{
while (1)
{
cursor_pos = str_cursor(my_str);
wait (1);

}
}



////////////////////////////////////////////////////////////////////
function main()
{
on_e = edit_text;
track_cursor();
video_mode = 7;
screen_color.blue = 150;

}
////////////////////////////////////////////////////////////////////////////////

Last edited by drwho; 07/05/09 18:01.

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