User Tools

Site Tools


en:examples:text_fonts:getting_text_font_from_an_object

Getting orxTEXT or orxFONT information from a Text orxObject

Code

	orxOBJECT *alphabetObject = orxObject_CreateFromConfig("AlphabetObject"); 
	orxGRAPHIC *graphic = orxGRAPHIC(orxOBJECT_GET_STRUCTURE( alphabetObject, GRAPHIC) ) ; 
 
	orxSTRUCTURE *structure = orxGraphic_GetData( graphic ); 
 
	orxTEXT *text = orxTEXT(structure); 
	orxFONT *font = orxText_GetFont(text); 

Config

[AlphabetObject] 
Graphic        = AlphabetGraphic 
Position    = (310, 140, -0.1) 
Color = (255, 0, 0) 
 
[AlphabetGraphic] 
Pivot = top left 
Text  = AlphabetText 
 
[AlphabetText] 
String    =    ABCDEF

en/examples/text_fonts/getting_text_font_from_an_object.txt · Last modified: 2018/02/14 08:47 (2 years ago) (external edit)