Starling Image change texture looks like lag and blurry - actionscript-3

In my project I implement the animation by change the bitmap's bitmapdata, now I try to use starling.
I try to change Image's texture each frame, the animation looks good when stand there. But when the animation moves, it looks like lag and blurry, and the fps never down.
The textures for the Image are in different size, so I called Image's readjustSize method when set texture. So I guess maybe cause the problem. I try same size textures, but the result is same.

I recommend you to use Movie Clip instead. If you want the control over playspeed, particular frames or anything else - it is there.
http://wiki.starling-framework.org/manual/movie_clips

Related

Circle shaped texture libGdx

I've been searching for answer for about 2 hours now and I haven't found my desired answer. My question is, Is it possible, and how, to draw a circle-shaped texture, so that outside the circle, texture would be transparent, is it even possible?
Thanks in advance! This site has been a great help so far!
The easiest way is to open a program like Photoshop and make an image with an alpha-channel. That means: Start with a completely transparent image and draw a circle on it. Then save it as .png
You can then just load it in your game and render it using a SpriteBatch. It (or better your graphics card) knows how to handle the alphachannel and will keep everything but the circle completely invisible.
This way you do not have to manipulate any pixmaps at runtime and you are not limited to simple shapes like circles.
If the portion of the texture you want to see in the circle is not meant to change during execution, the easiest way is to open Photoshop, make what you want, export it as an image and then load it in a Texture or a Sprite object in your code.
But this can also be done at runtime, via OpenGL using a Stencil test. This is the only solution if the portion displayed in the circle will have to be alterable during execution.
pixmap use this link if u are using other than .png format for your images
Apart form it if you are using png images then just draw the cirlce. Outside the circle will remain transparent.

As3 RotationX and RotationY blur the original image

I have a quick question regarding RorationX, Y, Z
Whenever i have applied that, my image gets blured
_eventParent.getChildAt(1) is a Sprite.
Any reason why? and how can i stop this?
_eventParent.getChildAt(1).rotationY = _differentX;
_eventParent.getChildAt(1).rotationX = _differentY;
When you rotate a sprite, it gets automaGically associated bitmap buffers for fast manipulation with the rendering engine. There are solutions for that, which are not very effective but here is a
link to the best so far method.

as3 movieclip antialias

I kept a bitmap inside a movieClip, bitmap has been set to be smoothing. but when I changed the scale of this movieclip, it still got pixelated. Do we have the way to avoid. it is really painful.
When you scale bitmaps, quality gets lost, always.
Always snap x and y positions to full pixels.
stage.quality = "best" gives you better anti-alliasing (bicubic), but it cost more CPU.
Try to find out what the maximum scale of the image could be. Then make the image at that size.
Most people dont't see its not that smooth, just make the game runs smooth and fun. so relax about it.

Joining Sprites together in AS3?

So created a Sprite to which I add other Sprites which are game tiles. Each tile is 60 x 60 px big. In result I've the Sprite with about 200 childs (those tiles).
When I try to startDrag() the container sprite the lag when moving it is very noticeable..
Is there a way like to join the tile Sprites so the container would have only 1 child Sprite instead of 200? Because it lags so much probably cause it needs to move (change the x and y) all those 200 tiles.. Am I correct?
In this case I can't use the cacheAsBitmap property, cause user can zoom in or zoom out the map..
Glycerine & Aurel do touch the crux of the real solutions. However I'd like to add.
You are correct by the way, when you said it has to manage so many sprite locations when you move the container around. CacheAsBitmap sure does does tackle this to great extent but the real solution is blitting. Try this link for that :
http://www.adobe.com/devnet/flash/articles/blitting_mc.html
It doesn't matter if a user zoom or something of that sort is required cause you can always switch between bitmap data & the original vector sprites. Your problem arises in moving.managing lotsa sprites, so just before doing that use optimizations, after that let them be back to their selves.
I've had the same issue before. Is it possible to 'join' them together - in a sense.
When you add your 200 sprites onto a screen - I assume you put them all into another parent sprite.
A this point - you will take a snapshot, or a screenshot - or a photographic replica (whatever you want to call it) of all the sprites and write the image (bitmapData) to a parent sprite. At this point. delete/remove/hide/nullify the original sprites and you'll be left with a sprite containing bitmap data.
One big image to move about and zooming and the like is no bother.
If you need code - ask. It's time consuming code so you tell me first then I'll write it :P
Hm, joining them would actually be quite hard... You would need to get the graphics, the code and all and put that into the parent...
I don't think that is the problem - you should do something else... In this case, I think that by "tiles" you mean that the parent would be a tile map, correct? So, you probably have a 2-dimensional array (array of arrays) with tile types - instead of parsing that array at initialization, creating A LOT of Sprites, try re-parsing it in each frame (it is faster), but add only the Sprites that are possible to see. That is - their X position (after adding the zoom and camera X) is greater than -sprite.width, where the height is also scaled by the zoom, and lesser than stage.width + sprite.width (again, width after zoom). Same goes for Y, only with the height attributes.

Flash PNG Quality on Tween

In Flash I have some PNG images, and I wish these images to become 50% larger on hover. However the tween I have used to make them larger distorts the quality of the images considerably.
For the tween I am not using any external libraries and I am using a standard scaleX tween.
Is there a way around this loss of quality?
Yes, start with images that are of the largest size they'll ever be, and scale them DOWN from there. So in your case, the normal size of the images will be 50% larger than they are now, which is how they will appear when hovered-over. When they are not hovered over, scale them down by 33%.
Also, make sure the bitmap.smoothing is set to true - I think this makes the flash smooth the bitmap even when scaling down.