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
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (BrainSailor), 862 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Font color #264637
05/07/09 11:49
05/07/09 11:49
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
How can i change the color of font if i use, for example,
FONT* arial_font = "Arial#20b";
?


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: Font color [Re: VeT] #264661
05/07/09 13:07
05/07/09 13:07
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
You don't. What you change is the the text's color:

FONT* arial_font = "Arial#20b";

TEXT* mytext =
{
flags = SHOW;
font = arial_font;
string("this will be red");
red = 255;
green = 60;
blue = 60;
}

Correct me if I'm wrong.


~"I never let school interfere with my education"~
-Mark Twain
Re: Font color [Re: Germanunkol] #264664
05/07/09 13:15
05/07/09 13:15
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
i'm stupid :))) this works great smile


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: Font color [Re: VeT] #264677
05/07/09 13:54
05/07/09 13:54
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
okay, and what about scaling?

Code:
	set(Reds_turn_text,SHOW);
	Reds_turn_text.pos_x = (screen_size.x - 80)/2;
	Reds_turn_text.pos_y = 100;
	
	Reds_turn_text.scale_x = 10;
	while(Reds_turn_text.scale_x > 1)
	{
		Reds_turn_text.scale_x -= time_step;
		wait(1);
	}


this shows text where its needed, but dont scale...


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: Font color [Re: VeT] #264678
05/07/09 14:00
05/07/09 14:00
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
text.font = "Arial#21b"; or render text into a bitmap use it in a panel and scale it.


3333333333
Re: Font color [Re: Quad] #264679
05/07/09 14:04
05/07/09 14:04
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
//text.font = "Arial#21b";
good idea, but i need to scale it dynaimcally... so Reds_turn_text.scale_x is looking like good variant, but i'm curious, why this doesnt work...

into a bitmap... i'd try, but looking like its too complicated method


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: Font color [Re: VeT] #264691
05/07/09 15:06
05/07/09 15:06
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
maybe it's only for bitmap fonts. idk really, never tried scaling TTF text dynamically.


3333333333
Re: Font color [Re: Quad] #264718
05/07/09 18:48
05/07/09 18:48
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl


"empty"
Re: Font color [Re: flits] #264736
05/07/09 20:35
05/07/09 20:35
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
nice solution, but isnt font change(or creation) a slow function? smile


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: Font color [Re: VeT] #264973
05/09/09 08:57
05/09/09 08:57
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
i never tried it but i gues you could create a array of fonts on start and then
just selesct the font you want white the array (just a lot of memory use)

i think somthing like this

FONT* font_arr[100];

function create_font_startup()
{
var i = 0;
while(i < 99)
{
...
font_arr[100] = font_create(...
i+=1;
}
}

function main
{
var size = 0;
while(size < 99)
{
my_text.font = font_arr[size];
size++;
wait(5);
}


"empty"

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