in AS3, Drawing TextField into BitmapData get a bad effect when parent get moved ( changing x, y )?
having a problem while drawing a complex combinations of TextFields into BitmapData in as3, and i can't understand the reason for that, so please help me with it.
The problem happens when i change the parent's (x,y) or (width, height) and the drawn object got a bad effect like left blur.
I attached an image of what going, and here is a snippet of the code :
//defining TextField object
var textField:TextField = new TextField();
textField.embedFonts = true;
textField.width = width;
textField.selectable = false;
textField.border = true;
var styl开发者_如何学编程esheet:StyleSheet = new StyleSheet();
stylesheet.parseCSS(css);
textField.styleSheet = stylesheet;
textField.multiline = true;
textField.autoSize = TextFieldAutoSize.LEFT;
textField.antiAliasType = AntiAliasType.ADVANCED;
textField.wordWrap = true;
textField.condenseWhite = true;
textField.htmlText = "<p>"+text+"</p>";
//after adding it to a MovieClip i draw it into a BitmapData
var btmd:BitmapData = new BitmapData(width, height);
btmd.draw(this.page,null,null,null,null, true);
Thanks for your help,
the reason behind this ugly problem is setting the x, y for the Object (or) parents with long float values. the solve is by setting the x, y to int.
In other words,
BitmapData.draw( obj );
obj.x, obj.y should be Integers, or an ugly effect will be affected the drawn object.
are you refreshing the bg? so before you draw btmd redraw the BG to clear the previously drawn bitmap data
I can't comment yet due to lack of rep, so I kinda have to put it here...
When I go to the link given, the problem being described does not appear.
Am I missing something?
Addition: You may try to adjust the sharpness of the textfield?
Also, perhaps consider when the bitmap is being made because everything might not be adjusted, but the bitmap may be created at that point?
Note: I still have not been able to get the grey that you showed in your post.
Sample at x2 size. Then scale the bitmap at 50%. It will look exactly like the original clip.
精彩评论