ID:2428141
 
(See the best response by Kaiochao.)
Code:
hud
Click(location,control,params)
animate(src, transform=matrix().Translate(rand(2,32),rand(2,32)), time=rand(4,20))


Problem description:

Why when i try move hud object on my screen my icon going blurred?
Is any alternative for matrix translate?
Pixel_x and _y also are good alternative, i think..


Is this with PIXEL_SCALE in the appearance_flags?

The blur is from the pixels being aliased as they move between rendered pixels.
In response to Kaiochao
Kaiochao wrote:
Is this with PIXEL_SCALE in the appearance_flags?
No, when i add this flag, it's stop blurred, but icon is shaking when it's moving.

#include<kaiochao/shapes/shapes.dme>
atom/appearance_flags = PIXEL_SCALE

world
fps = 60
maxx = 25
maxy = 25
turf = /turf
mob = /mob

turf
icon_state = "rect"
New()
..()
color = (x + y) % 2 ? rgb(50, 50, 50) : rgb(55, 55, 55)

mob
step_size=2
Login()
..()
new/obj/hud(locate(3,3,1))
new/obj/hud(locate(6,3,1))

obj/hud
icon='mob.dmi'

Click(location,control,params)
animate(src, transform=matrix().Translate(rand(2,32),rand(2,32)), time=rand(4,20))


In response to Marekssj3
Best response
The "shaking" is due to the icon's position being rounded to the nearest whole pixel, which is most noticeable when moving very slowly at certain angles (like, when moving actually involves moving up some pixels and then moving right etc.).

This isn't something you can solve in BYOND (unless you upscale everything such that rendered pixels are much smaller than icon pixels), since zooming in the map element doesn't increase the resolution of the graphics at all. Basically, you're moving too slowly for how big your pixels appear to be.