Slow Moving Objects (Visual)
When I try to move graphical objects across the screen at steps which are not whole numbers (for example, 0.5 pixels per frame) this results in choppy and 'laggy' movement; as the object will simply move 1 pixel every two frames.
I understand why this is happening as the x / y values of an object must be Integers, but I wonder if there is anyway to c开发者_运维技巧reate smooth slow movement, such as there is in Adobe Flash.
Graphics2D
allows you to draw at sub-pixel accuracy and as long as your actual object is drawn using its primitive (as opposed to being a fixed bitmap), this should actually have a visible effect.
Make sure that the KEY_ANTIALIASING
rendering hint is set to VALUE_ANTIALIASING_ON
精彩评论