ios - CATextLayer in SCNBox shows in portrait mode -
i trying write text onto scnbox node. see text in box text orientation portrait. how make landscape?
calayer *layer = [calayer new]; [layer setframe:cgrectmake(0, 0, 100, 100)]; [layer setbackgroundcolor:[uicolor redcolor].cgcolor]; catextlayer *textlayer = [catextlayer new]; [textlayer setframe:[layer bounds]]; [textlayer setfontsize:24]; [textlayer setstring:@"test"]; [textlayer setalignmentmode:kcaalignmentleft]; [textlayer setforegroundcolor:[uicolor blackcolor].cgcolor]; [textlayer display]; [layer addsublayer:textlayer]; scnbox *box = [scnbox boxwithwidth:1 height:2 length:0.005 chamferradius:0.0]; [[[box firstmaterial] diffuse] setcontents:layer]; // [[[box firstmaterial] diffuse] setcontents:[uicolor redcolor]]; [[box firstmaterial] setlightingmodelname:scnlightingmodelconstant]; [[box firstmaterial] setdoublesided:yes]; scnnode *node = [scnnode nodewithgeometry:box];
Comments
Post a Comment