Report as inappropriate.
This is a little demo for my implementation of a magnifier, which is quite memory efficient and fast.
The files you need to copy are the Magnifier class and the Magnifiable interface. For an actor to be magnified by the Magnifier, it must implement the Magnifiable interface. The world where you use the Magnifier must also have this line:
in its constructor.
A magnifier is created with 4 arguments: width, height, scale and doesRotation. The first 3 are obvious, but the fourth needs a little explanation. When doesRotation is false, the magnifier will pay no attention to the rotation of actors (i.e. it draws their images with rotation 0). This will improve performance, so use this ability when possible.
In this demo, the magnifier follows the movement of your mouse cursor. The bugs are added at random locations.
2568 views / 199 in the last 7 days
2 votes | 0 in the last 7 days
This scenario is a member of: Reusable actors & support classes
Want to leave a comment? You must first log in.