This content has been marked as final. Show 6 replies
Does this help?
Yellow lines that you can see in my examples is just background that isnt a part of number object.
That number object is a "flying" object (parent script) that I want to move over that bkg.
I create a number image by pasting digit images 1 by 1 for every digit in variable that I want to represent.
I paste them (with copyPixels) on lingo-created image() so it is independent graphic object.
I think the problem may lay in merging alpha channels of digits that overlaps each other.
Maybe there is a way to merge 2 "soft" alpha channels ?
Anyway, thank You for this example, will be useful for me in other way :)
Can you post your digit images somewhere so that I can work with them directly, rather than trying to second-guess what you are doing? Thanks.
Here's how I rearranged your cUpdate() handler to work with my AlphaPaste() method. Although mine may look very different from yours, this is because I have taken most of your hard-coded values and assigned them to variables at the beginning of the handler. It's good practice to define a value only once. The only real changes are:
1) I make the cGfx transparent just after I create it
2) I call AlphaPaste() and you call copyPixels.
I've altered my AlphaPaste() method so that it copies the alpha channel in a separate operation, before reapplying the alpha channel.
The only problem is that it hardens alpha channel on the edges of each digit.
The best way I found is just copy each digit separately to destination image without alpha.
I gues it's little slower then prepare whole number and copy it every enterFrame but I guess I have no option ;)
Thank you for your time, I've lerned a lot from your examples code anyway :)