I knocked up a quick demo to show how you might create a Unity game, which uses either keyboard input, or the accelerometer of a mobile device, without having to change any code, include any third party libraries, or use conditional compilation. Continue reading Unity – automatically choosing key or accelerometer input
A common oversight in Flash projects, when using a Bitmap with loaded content is that Flash will revert a Bitmap’s smoothing parameter to false when you replace its bitmapData. That is, when the data loads into the Bitmap, anti-aliasing will get turned off. This is simple enough to fix, but since you may not know if someone is going to replace the bitmapData of a Bitmap you have created – then it’s much better to code defensively for it.
This little SmoothBitmap class is for just such an occasion. Instantiate it like a regular Bitmap and, no matter what another developer does with it, smooth, anti aliased pixels when scaling/rotating will be ensured. Enjoy 🙂
I had a conversation yesterday with a friend and colleague about how his company should standardise their development environment for all Flashers – be they contract or perm, junior to senior.
You need to use some kind of Dependency Injection (DI for short) to provision some System Under Test (SUT for short) in tests you’re writing, but can’t or don’t want to use a DI framework to do so.
Alternative titles for this post include:
- Dependency Injection without a Dependency Injection framework
- Why misusing the default namespace for tests is evil
- Make code more testable without completely messing it up
You want to embed an entire SWF, full of assets, into a class and retrieve individual symbols from it – but you don’t want to have to embed each asset individually.
SWFAsset – a couple of lines of code and you’re away.
You’re using Flash 10’s native 3-D API and notice the projection goes a little skewiff when resizing the window.
You need to reset the stage’s projection centre on stage resize, like so…
var centre:Point = new Point(stage.stageWidth/2, stage.stageHeight/2);
root.transform.perspectiveProjection.projectionCenter = centre;