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
2 registered members (AndrewAMD, alibaba), 1,426 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 4
Page 2 of 3 1 2 3
Re: variable width bitmap font renderer - free (A6 [Re: HeelX] #152384
10/13/07 20:44
10/13/07 20:44
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline
User
demiGod  Offline
User

Joined: Mar 2006
Posts: 752
Portugal
Yeah, sorry HeelX

actually your tool is working fine, i had to redefine all panels positioning and at the beginning it seems that the align wasnt working, but it is.

About the second question, there´s a way to use the font with inkey function, for the players enter their names?

Thanks
Jorge

Re: variable width bitmap font renderer - free (A6 [Re: demiGod] #152385
10/14/07 13:08
10/14/07 13:08
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Of course: start inkey and refresh each time a key is pressed (or each frame if you like) the bitmap and stop refreshing when the the user finished typing.

Re: variable width bitmap font renderer - free (A6 [Re: HeelX] #152386
10/14/07 19:30
10/14/07 19:30
Joined: Mar 2003
Posts: 4,264
Wellington
Nems Offline

.
Nems  Offline

.

Joined: Mar 2003
Posts: 4,264
Wellington
Awesome thanks HeelX.

Re: variable width bitmap font renderer - free (A6 [Re: Nems] #152387
10/14/07 23:21
10/14/07 23:21
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline
Serious User
VeT  Offline
Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
Thats great...
Thanks, HeelX


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: variable width bitmap font renderer - free (A6 [Re: HeelX] #152388
10/15/07 03:01
10/15/07 03:01
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline
Expert
mpdeveloper_B  Offline
Expert

Joined: Feb 2006
Posts: 2,185
. . . :[___


- aka Manslayer101
Re: variable width bitmap font renderer - free (A6 [Re: mpdeveloper_B] #152389
10/15/07 11:09
10/15/07 11:09
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Quote:

. . . :[___




what?

Re: variable width bitmap font renderer - free (A6 [Re: mpdeveloper_B] #152390
10/15/07 11:12
10/15/07 11:12
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline
User
demiGod  Offline
User

Joined: Mar 2006
Posts: 752
Portugal
Thanks HeelX,

but im having some problems to make the inkey function works, maybe because i have so many things to do at same time, and im not paying the needed attention.

So, please could you make a simple example how to implement it ? I really appreciate it.

Of course we will give you credits when Xtreme Paintball is done, because of this great tool we are using here.

Code:


if (connection > 1)
{
while (!str_len(playerName))
{
p_insertName.visible = on;
p_background.visible = on;
p_build.visible = on;
p_logo.visible = on;

str_cpy (playerName, "new player ");
RF_setFontRenderSettings(RF_CONSTANTS_CENTER, 0);
RF_pnlRenderString(show_name, paintballFont, playerName);
inkey (playerName);
}
}



Thanks,
Jorge

Last edited by demiGod; 10/15/07 11:18.
Re: variable width bitmap font renderer - free (A6 [Re: demiGod] #152391
10/15/07 12:05
10/15/07 12:05
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
You have to update the string-bitmap while inkey is active. Unfortunately, inkey pauses the running function. So, you have to start a coroutine BEFORE you execute inkey which runs as long as inkey is active.

Make a new WDL file called "demo_inkey.wdl" and start it in the sample folder with the sample font to see how it works.

Code:
include "fontRender.wdl";

PANEL pleaseEnterName
{
flags = visible;
pos_x = 10;
pos_y = 10;
layer = 999;
}

PANEL userName
{
flags = visible;
pos_x = 280;
pos_y = 10;
layer = 999;
}

var fontArial[256];
string tempStr;
string userNameStr;

function inkeyRefresh (pnl, &fnt, strInkey);

function main ()
{
vec_set(screen_color, vector(128,128,128));

RF_createFont(fontArial, "arial.tga");

RF_pnlRenderString(pleaseEnterName, fontArial, "Please enter your name:");

inkeyRefresh(userName, fontArial, userNameStr);
inkey(userNameStr); //function will be paused until inkey is over

userName.visible = off;

//say hello to the user
RF_pnlRenderString(pleaseEnterName, fontArial, str_cat(str_cat(str_cpy(tempStr, "Hello, "), userNameStr), "!"));
}

function inkeyRefresh (pnl, &fnt, strInkey)
{
wait(1); //wait to let inkey start (proc_late doesn't work for this)

//wait until inkey is finished
while (inkey_active) {

//update text rendering
RF_pnlRenderString(pnl, fnt, strInkey);

wait(1);
}
}



Cheers, Christian

Last edited by HeelX; 10/15/07 12:05.
Re: variable width bitmap font renderer - free (A6 [Re: HeelX] #152392
10/15/07 14:17
10/15/07 14:17
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline
User
demiGod  Offline
User

Joined: Mar 2006
Posts: 752
Portugal
Thanks, its working now:

Code:


if (connection > 1)
{
while (!str_len(playerName))
{
p_insertName.visible = on;
p_background.visible = on;
p_build.visible = on;
p_logo.visible = on;

//--- INKEY
str_cpy (playerName, "new player ");
RF_setFontRenderSettings(RF_CONSTANTS_CENTER, 0);
RF_pnlRenderString(show_name, paintballFont, playerName);
inkeyRefresh(show_name, paintballFont, playerName);
inkey(playerName);
}
}



Re: variable width bitmap font renderer - free (A6 [Re: HeelX] #152393
10/15/07 14:21
10/15/07 14:21
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline
Expert
mpdeveloper_B  Offline
Expert

Joined: Feb 2006
Posts: 2,185
Quote:

Quote:

. . . :[___




what?




sorry, i was drooling over it's excellence


- aka Manslayer101
Page 2 of 3 1 2 3

Moderated by  adoado, checkbutton, mk_1, Perro 

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