2D question: colored text

Posted By: frank58

2D question: colored text - 03/18/10 20:54

In lite C you can create text in two ways:

1) by digits in panels
2) by TEXT* declaration

But, what about colored text?

Best regards
frank58
Posted By: Razoron

Re: 2D question: colored text - 03/18/10 21:06

Code:
yourtext.red
yourtext.green
yourtext.blue


Posted By: Quad

Re: 2D question: colored text - 03/18/10 21:08

same for coloring digits on panels.
Posted By: MMike

Re: 2D question: colored text - 03/18/10 21:26

individual digits with different colors.. would be nice.
Posted By: Espér

Re: 2D question: colored text - 03/18/10 22:31

create multiple panels/texts with different colors.. but only a few of the string letters per panel...

at the end.. put them all overlaying each other.. and you got a compete text in different color.
Posted By: Elektron

Re: 2D question: colored text - 03/19/10 09:04

I tried several ways and i failed to implement the code frown
Please, make a more detailed explantion or code.

Thanks in advance
Posted By: MMike

Re: 2D question: colored text - 03/20/10 04:16

that thing of multi panel, sucks so much.. i mean what a wast of code lines..
But i guess conitec put on betapage, coloring for digits individually!! yes.. thats it..
Posted By: frank58

Re: 2D question: colored text - 03/20/10 14:50

First example of my initial question:
In the script below how do I color text digits in the panel?
Can I use different colours for the two text digits?
Thanks for the answers.

//Colored Panel Text
#include <acknex.h>
#include <default.c>
////////////////////////////////////////////////////////////////////

PANEL* first_pan =
{
digits (85, 620, "TEXT1","Arial#125b",1, 0 );
digits (650, 620, "TEXT2","Arial#125b",1, 0 );
flags = SHOW | OUTLINE;
}

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

function main()
{
video_screen = 1;//full screen=1, default =2 windows mode
screen_size.x = 1024;
screen_size.y = 768;
}
Posted By: Superku

Re: 2D question: colored text - 03/20/10 14:52

http://manual.3dgamestudio.net/beta.htm

-> pan_setcolor
Posted By: frank58

Re: 2D question: colored text - 03/21/10 07:59

I have SED version 7.35.
Instruction pan_setcolor is not in this version.
Posted By: Elektron

Re: 2D question: colored text - 03/21/10 08:36

I was searching too and i found laugh
Code:
set(info_pan,LIGHT); // modulate all panel bitmaps with the given color
vec_set(info_pan.blue,vector(0,0,255)); // red color



Change "info_pan" to name of your panel.

I am not sure if is the right way, but it works.
I know is boring but sometimes is better to make a search on 3DGS Manual.
Lesson of day laugh

I hope it helps
Posted By: frank58

Re: 2D question: colored text - 03/21/10 11:37

I know those instructions (set,vecset), they color all Panel elements, but in case of text Panels are OK.
Thanks for help
Posted By: frank58

Re: 2D question: colored text - 03/23/10 14:36

This is the complete code for components panel color:

//Colored Panel Text
#include <acknex.h>
#include <default.c>
////////////////////////////////////////////////////////////////////

PANEL* first_pan =
{
digits (85, 620, "TEXT1","Arial#125b",1, 0 );
digits (650, 620, "TEXT2","Arial#125b",1, 0 );
flags = SHOW | OUTLINE;
}

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

function main()
{
video_screen = 1;//full screen=1, default =2 windows mode
screen_size.x = 1024;
screen_size.y = 768;
set(first_pan,LIGHT); // modulate all panel bitmaps with the given color
vec_set(first_pan.blue,vector(0,255,0));//all panel components green color
//vec_set(first_pan.blue,vector(0,0,255));//all panel components red color
//vec_set(first_pan.blue,vector(255,0,0)); //all panel components blue color
}
© 2024 lite-C Forums