Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Ayumi), 1,170 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Text #298221
11/12/09 23:58
11/12/09 23:58
Joined: Nov 2009
Posts: 34
S
Sepiantum Offline OP
Newbie
Sepiantum  Offline OP
Newbie
S

Joined: Nov 2009
Posts: 34
How would I make text appear on the screen and then disappear. I want to say: "Keep your ship in the game!!!" for like 2 seconds and then I want it to disappear. Halp me plzkthnx.

Re: Text [Re: Sepiantum] #298225
11/13/09 00:19
11/13/09 00:19
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!

From the manual wink

Quote:

Example:
STRING* welcome_str = "Welcome";

TEXT* welcome_txt =
{
layer = 1;
pos_x = 10;
pos_y = 10;
string (welcome_str,"this is","a","TEXT");
// flags = CENTER_X | TRANSLUCENT | SHOW;



in a function

....
set (welcome_txt, SHOW);
wait (-2);
toggle (welcome_txt, SHOW);
...


Hope this helps!
Ottawa laugh

Ver 7.86.2 Pro and Lite-C
Re: Text [Re: Ottawa] #298226
11/13/09 00:38
11/13/09 00:38
Joined: Nov 2009
Posts: 34
S
Sepiantum Offline OP
Newbie
Sepiantum  Offline OP
Newbie
S

Joined: Nov 2009
Posts: 34
ok, when video_mode = 7, and pos_x = 400, pos_y = 300, and the flags = CENTER_X | CENTER_Y | SHOW, the text is centered. Any help with that?

Re: Text [Re: Sepiantum] #298271
11/13/09 12:53
11/13/09 12:53
Joined: Oct 2007
Posts: 306
Austria
A
Alan Offline
Senior Member
Alan  Offline
Senior Member
A

Joined: Oct 2007
Posts: 306
Austria
Hi,

the decisive command for centering the text on screen is this one:

flags = CENTER_X|CENTER_Y|SHOW;

You need to have this inside your text object definition to make it work. "SHOW" will cause your text to be actually visible on screen (so if you switch SHOW back to off, it will disappear again). "CENTER_X" will center the contents of your text object (just as when you select a text and click "center" in Microsoft Word or write "div_align = center" in HTML or...). Finally, "CENTER_Y" does the same thing as CENTER_X, just in a vertical manner instead of a horizontal one.

I hope I could help you with that ^^

Greets,



Alan

Re: Text [Re: Alan] #298444
11/15/09 03:24
11/15/09 03:24
Joined: Nov 2009
Posts: 34
S
Sepiantum Offline OP
Newbie
Sepiantum  Offline OP
Newbie
S

Joined: Nov 2009
Posts: 34
Yeah okay, I did that, but when video_mode is 7, pos_x is 400, pos_y is 300, and the flags are as you specified, it still isn't in the center.

Re: Text [Re: Sepiantum] #298454
11/15/09 07:59
11/15/09 07:59
Joined: Mar 2009
Posts: 88
Walori Offline
Junior Member
Walori  Offline
Junior Member

Joined: Mar 2009
Posts: 88
well you could try aligning the text something like this:

Code:
TEXT* test_txt={
pos_x = 0;
pos_y = 0;
layer = 100;
...
}

void main(){
test_txt.pos_x = screen_size.x/2;
test_txt.pos_y = screen_size.y/2;
test_txt.flags = CENTER_X | CENTER_Y | SHOW;
...
}



With that no matter which resolution you would have th text would allways be centered on the screen.

Re: Text [Re: Walori] #298520
11/15/09 18:08
11/15/09 18:08
Joined: Nov 2009
Posts: 34
S
Sepiantum Offline OP
Newbie
Sepiantum  Offline OP
Newbie
S

Joined: Nov 2009
Posts: 34
Thank you!!! I did some testing and realised that my resolution was 720x480 instead of 800x600 like it was supposed to be. Go figure.


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