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.
Related
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
I'm making a top-down game in flash, and I need to have the whole game zoomed in; the characters and scenery are really small. If I increase the height and width in flash, it messes up the image, putting pixels and strange coloration where they shouldn't be. What I am looking for is a way to change the size of the pixels, or something to that effect.
You'll 'mess up' a bitmapped image by enlarging it beyond its resolution. Two easy solutions: 1. Make your characters and scenery as vector images. Or 2. If you want them to be bitmaps (jpgs, png, whatever) create them initially at a size == the largest size you'll get to in your zoom. Then scale them down on stage to their starting scale. When you zoom in they'll look good.
I am slightly confused about the "correct" way in KineticJS to fill a shape with partial images (crops) from a combined image file (sprite).
Seems like one can either use fillPatternImage with a defined offset, which seems to draw the complete image, albeit with the rest of the image invisible. I only got acceptable performance after I moved those shapes to an extra layer as my sprite is relatively large and the impact of not cropping correctly decreased the fps dramatically.
All alternatives that I have found use the attribute "fill" with another attribute "image" in it, but this seems to result in black background every time.
Using an Image-shape would help, but is rarely usable since my shapes are seldom rectangular.
Since the KineticJS-documentation does not mention specifying crop coordinates ("just" offset, w/o width and height), what is the absolute correct way to do it?
The absolute "absolute correct way" would depend on the platform and your particular code, but.
Have you looked at sprites? http://www.html5canvastutorials.com/kineticjs/html5-canvas-kineticjs-sprite-tutorial/.
To mask simple animated sprites I'd use this in adition of plain javascript after each draw.
context.globalCompositeOperation = 'destination-in';
The performance of drawImage with composite operations is better than drawing shapes manually on webkit, at least.
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.
I have a problem where the images look a little pixelated because they have been scaled down alot, just need a way to make everything appear smoother.
I need the game I'm making to look high quality and also work at different resolutions so when I made all the graphics I made them massive and same for the stage size in flash.
The stage size is 2000*1500 and it's being scaled down to 800*600 which is an exact ratio, I didn't expect to see pixelization when scaling the images DOWN, that's why I made them so large.
If there's no options for smoothing things out, then does anyone know the best option for swapping images at run-time? This way I can have pre-made images for all the most popular resolutions.
If you are using bitmaps, try smoothing and pixelsnapping:
image.smoothing = true;
image.pixelSnapping = "never";
If you have library images (bitmaps), try changing "Allow Smoothing" and "Compression"
If you want to automate this you can use JSFL:
http://mrsteel.wordpress.com/2007/06/12/flash-jsfl-script-allow-smoothing-on-all-bitmaps-in-library/