Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Ayumi), 1,353 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Strings above entities of dynamic entities? #129029
05/10/07 03:37
05/10/07 03:37
Joined: Dec 2005
Posts: 6
chihchang Offline OP
Newbie
chihchang  Offline OP
Newbie

Joined: Dec 2005
Posts: 6
I have readed AUM 32 about Strings above entities.
I have a question.
How to do that if there's dynamic entities? maybe from 1 to 100 of entities.
I know there's no TEXT* pointer.
Anyone can help?

Re: Strings above entities of dynamic entities? [Re: chihchang] #129030
05/10/07 07:29
05/10/07 07:29
Joined: Oct 2003
Posts: 702
Z
zazang Offline
User
zazang  Offline
User
Z

Joined: Oct 2003
Posts: 702
You can create dynamic texts from A6.4 onwards.
here is some more info :- http://manual.conitec.net/atxt_create.htm


I like good 'views' because they have no 'strings' attached..
Re: Strings above entities of dynamic entities? [Re: zazang] #129031
05/11/07 06:28
05/11/07 06:28
Joined: Dec 2005
Posts: 6
chihchang Offline OP
Newbie
chihchang  Offline OP
Newbie

Joined: Dec 2005
Posts: 6
How to set text position after using TEXT* txt_create?
I want using strings(player names) above entities.

thank you.

Re: Strings above entities of dynamic entities? [Re: chihchang] #129032
05/11/07 07:49
05/11/07 07:49
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
my_txt = txt_create(1,1);

my_txt2 = txt_create(1,1);

... and so on. then you can change the position of my_txt.pos_x and .pos_y


inside a model's action, try:


while(1)
{
vec_set(temp,my.x);
vec_for_screen(temp,camera);
my_txt.pos_x = temp.x;
my_txt.pos_y = temp.y;
wait(1);
}


dunno if this works... but it should move the text to the model's position.

good luck,
micha


~"I never let school interfere with my education"~
-Mark Twain
Re: Strings above entities of dynamic entities? [Re: Germanunkol] #129033
05/11/07 08:13
05/11/07 08:13
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
You need to use vec_to_screen, not vec_for_screen

while(1)
{
vec_set(temp,my.x);
temp.z += my.max_z + 10; // Above the entity
vec_to_screen(temp,camera);

my_txt.pos_x = temp.x;
my_txt.pos_y = temp.y;
wait(1);
}

Re: Strings above entities of dynamic entities? [Re: chihchang] #129034
05/11/07 08:45
05/11/07 08:45
Joined: Oct 2004
Posts: 1,655
T
testDummy Offline
Serious User
testDummy  Offline
Serious User
T

Joined: Oct 2004
Posts: 1,655
Really!!!? TEXT* pointers were added to C-Script???! That's great news.
Code:
ptr_for_handle(varH).pos_x = value;  //???



Quote:

but it should move the text to the model's position.



WTF. I noticed some completely surprising, absolutely unexpected, compile-type errors when I tried to apply TEXT specific thingies to a var dojigger. Please tell me what I did wrong, so that I might neutralize the errors.

edit: Problem solved. I wasn't paying attention and didn' t realize that TEXT IS_A PANEL.
Code:

PANEL* my_txt1;
my_txt1 = txt_create(1, 1);
my_txt1.pos_x = 1;
my_txt1.pos_y = 1;
txt_load(my_txt1, "uiSave0.txt");
my_txt1.visible = on;
//perfect!!! C-Script ROX your baby booties off




I've written a C++ plugin (for use with C-Script) which allows the dynamic creation of some 3DGS UI elements.
The plugin is a work in progress but some components are functional.
->dynamic creation, rough manipulation and simple management of panels, buttons (with or without 3DGS TEXT elements), labels, rudimentary checkboxes, rudimentary text fields, text numeric input spinners...(all of which require some C-Script interaction)
->small portions of dynamic editor test sample with persistence (open / save functionality)
I believe currently, the plugin could be used to create, a dynamic number of panels with optional images, an optional runtime selectable number of text strings moved with those panels, an optional dynamic number of buttons, optional TEXT elements moved with those buttons on the panels, an optional dynamic number of numeric input spinners including text... Such components could be tied to and placed over entities without a whole lot of effort...
Actually such a plugin probably doesn't represent an optimal solution HERE.

On this page a file named _0c.wdl is listed.
In that script file, there are functions named drawxxx, which utilize draw_text functionality.
For example, if I would like to display the values of two skills and the position for an entity over that entity using three lines of text, I might write:
Code:

drawVar0("skill1 = ", my.skill1, vector(my.x, my.y, my.z + my.max_z), -2); //line -2
drawVar0("skill2 = ", my.skill2, vector(my.x, my.y, my.z + my.max_z), -1); //line -1
drawVec0("my.x = ", my.x, vector(my.x, my.y, my.z + my.max_z) 0); //line 0


Also there are two drawStrX functions.

Last edited by testDummy; 05/11/07 09:29.
Re: Strings above entities of dynamic entities? [Re: Germanunkol] #129035
05/11/07 18:22
05/11/07 18:22
Joined: Dec 2005
Posts: 6
chihchang Offline OP
Newbie
chihchang  Offline OP
Newbie

Joined: Dec 2005
Posts: 6
Quote:

my_txt = txt_create(1,1);

my_txt2 = txt_create(1,1);

... and so on.



What if the max text strings are 50, I need to
my_txt1 = txt_create(1,1);
my_txt2 = txt_create(1,1);
.
.
my_txt50 = txt_create(1,1);

Is that right?

Re: Strings above entities of dynamic entities? [Re: chihchang] #129036
05/11/07 22:33
05/11/07 22:33
Joined: Oct 2004
Posts: 1,655
T
testDummy Offline
Serious User
testDummy  Offline
Serious User
T

Joined: Oct 2004
Posts: 1,655
@chilhchang
I'll assume, for the most part, you ignored my post (somewhat recommended) and that your new question is not directed at me.
However, I will clarify.
Roughly 50% of my post, (the first portion) should not be taken seriously.
(The plugin statements, statements concerning draw_text and _0c.wdl may be taken seriously, but it appears those statements were ignored anyway.)
I assumed, the type of my_txt1 and my_txt2 was var, as the type was not explicitly defined in this thread, and seemingly the compiler / engine didn't allow C-Script TEXT* pointers on this machine (somewhat known beforehand through experimentation and examination of a thread).
Also, it seemed the compiler / engine didn't allow the manipulation of text properties on a variable of type var on this machine, but that was easily assumed to be the case without experimentation.
Furthermore, partial manipulation of text properties through a 'pointer' defined as type PANEL* is NOT recommended. Really, the notion is considered to be ridiculous or moronic (as intended).
Either I'm missing some information, I've done something improperly, or this just doesn't work in pseudo-current 'public' A6 versions with C-Script (as was already assumed previously, although I installed a state of mock ignorance and shouldn't have) :
Code:

var my_txt1;
my_txt1 = txt_create(1, 1);
my_txt1.pos_x = 5;
my_txt1.pos_y = 5;


I hinted at some solutions, but apparently you have selected an alternate which is seemingly 'unknown' to me, or just not viable.
I'm going to plead ignorance once again, but I'm not going to pretend that I think static 'hard-coding' or explicit typing of my_txtN definitions for 50 elements is 'a solution' or a 'solution proposal'.
Of course, I just assumed C-Script was being used and not Lite-C because of the forum section the thread was placed in, so maybe that was my error.
"Slacker's question for 0.1 pts:" are help files with an 'a' prefix more applicable to C-Script or Lite-C?


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