Avatar pixelation
Avatar pixelation
Hi, I'm creating an avatar from bitmapdata and inputting it into openspace. Everything works out great, except that when the user zooms in or out from the default zoom, the avatar gets destorted/pixelated. Is there an easy workaround for this? Because of the way our app is structured we have to use bitmaps for performance reasons.
SmartFoxServer and OpenSpace developer
www.edgarmiranda.net
www.edgarmiranda.net
How does resizing work when you load a bitmap into OpenSpace? By what factor is the bitmap resized?
SmartFoxServer and OpenSpace developer
www.edgarmiranda.net
www.edgarmiranda.net
Is there anyway to not apply scaling to the avatar? We would like to just change the avatar to a different bitmap (which is scaled before runtime). We are trying to avoid scaling the avatar (since it's a bitmap) so we avoid pixelation all together.
SmartFoxServer and OpenSpace developer
www.edgarmiranda.net
www.edgarmiranda.net
No, this is not possible. Avatars are nested sprites inside the map container, which is being scaled.warhell wrote:Is there anyway to not apply scaling to the avatar? We would like to just change the avatar to a different bitmap (which is scaled before runtime). We are trying to avoid scaling the avatar (since it's a bitmap) so we avoid pixelation all together.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
Is the scaling applied via setting the scale properties or multiplying the existing scale properties?
e.g.
obj.scaleX = newScale;
obj.scaleY = newScale;
or
obj.scaleX *= newScale;
obj.scaleY *= newScale;
I'm assuming it's applied the first way, I'm asking because if it's done the second way I can modify the scaling factor in the constructor, such that the scaleX and scaleY properties are 1.
e.g.
obj.scaleX = newScale;
obj.scaleY = newScale;
or
obj.scaleX *= newScale;
obj.scaleY *= newScale;
I'm assuming it's applied the first way, I'm asking because if it's done the second way I can modify the scaling factor in the constructor, such that the scaleX and scaleY properties are 1.
SmartFoxServer and OpenSpace developer
www.edgarmiranda.net
www.edgarmiranda.net
Ahh, so I guess a nice hack would be to stick my avatar bitmap inside a movieclip, and scale that movieclip by a factor such that when openspace scales (when zooming) the scaling of the bitmap is 1?bax wrote:The scaling is applied in the first way. Also, the scaling is not applied to each movieclip (tiles, avatars, etc) independently, but to the overall container.
SmartFoxServer and OpenSpace developer
www.edgarmiranda.net
www.edgarmiranda.net
For example, say that I set the zoom value of openspace to be .5. This means that every object's xscale and yscale property (that is located inside openspace) will be changed to .5. So, if I stick my bitmap in a movieclip who's xscale and yscale is 2, once openspace resizes everything, the original bitmaps scale will be the equivalent of 1.
SmartFoxServer and OpenSpace developer
www.edgarmiranda.net
www.edgarmiranda.net