This wiki is out of date, use the continuation of this wiki instead

Get text color

From FenixWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 18:39, 23 July 2007 (edit)
Rincewind (Talk | contribs)
(New Article)
← Previous diff
Current revision (00:00, 15 November 2007) (edit) (undo)
Sandman (Talk | contribs)
m (Example)
 
(3 intermediate revisions not shown.)
Line 5: Line 5:
'''INT''' get_text_color() '''INT''' get_text_color()
-Gets the current text color (the color where texts will be written in). When you're running in 8 bit color mode, this function will return the palette index, when you're in 16 bit mode it will return a RGB number which can be turned into it's components using [[get_RGB]](). +Gets the current text [[color]] (the [[color]] where texts will be written in).
== Parameters == == Parameters ==
Line 11: Line 11:
== Returns == == Returns ==
-''<If someone knows, please edit!>''+'''INT''': [[color]] the text will be written in.
== Notes == == Notes ==
Line 23: Line 23:
Program test; Program test;
Global Global
- My_text;+ my_text;
- Text_color;+ text_color;
Begin Begin
- Set_text_color(120); 
- Write(0,320/2,200/2,4,"The color of this text is:"); 
-  
- Text_color=Get_text_color(); 
- Write_int(0,320/2+100,200/2,4,offset Text_color); 
- Loop+ set_text_color( rgb(192,112,0) );
- Frame;+ text_color = get_text_color();
- End+ 
 + write (0,320/2 ,200/2,4,"The color of this text is:");
 + write_int(0,320/2+100,200/2,4,&text_color);
 + 
 + Repeat
 + frame;
 + Until(key(_ESC))
 + 
End End
</pre> </pre>
-Used in example: [[set_text_color]](), [[write]](), [[write_int]]()+Used in example: [[set_text_color]](), [[write]](), [[write_int]](), [[key]]()
-This will result in something like:<br />+This will result in something like:<br>
[[Image:get_text_color.png]] [[Image:get_text_color.png]]

Current revision


Contents

[edit] Definition

INT get_text_color()

Gets the current text color (the color where texts will be written in).

[edit] Parameters

None.

[edit] Returns

INT: color the text will be written in.

[edit] Notes

None.

[edit] Errors

<If someone knows, please edit!>

[edit] Example

Program test;
Global
    my_text;
    text_color;
Begin

    set_text_color( rgb(192,112,0) );
    text_color = get_text_color();

    write    (0,320/2    ,200/2,4,"The color of this text is:");
    write_int(0,320/2+100,200/2,4,&text_color);

    Repeat
        frame;
    Until(key(_ESC))

End

Used in example: set_text_color(), write(), write_int(), key()

This will result in something like:
Image:get_text_color.png

Personal tools