When attaching images or overlays with an offset (through translation matrix or pixel_x/y) to an object, rotating that object doesn't cause the attached images to revolve around the object. The images only spin in place.
Numbered Steps to Reproduce Problem:
1. Make image
2. Translate image's transform
3. Attach image to object
4. Make object constantly spin
Code Snippet (if applicable) to Reproduce Problem:
world
maxx = 5
maxy = 5
fps = 30
var matrix/Matrix
mob/Login()
..()
// A white circle in the center of the world
loc = locate(3, 3, 1)
icon = 'shapes.dmi'
icon_state = "circle"
// A red square with an offset of (0, 32)
var image/i = image('shapes.dmi', "square")
i.color = "red"
Matrix = new
Matrix.Translate(0, 32)
i.transform = Matrix
overlays += i
// Can also use i.loc; src << i
// Spin src constantly
animate(src, transform = turn(transform, 120), time = 10/3, loop = -1)
animate(transform = turn(transform, 120), time = 10/3)
animate(transform = turn(transform, 120), time = 10/3)
// Can also use an infinite loop
// and transform = turn(etc.
Expected Results:
Red square revolves around the white circle
Actual Results:
Red square spins in place on top of the white circle
Does the problem occur:
Every time? Or how often? every time
In other games? eh
In other user accounts? sure
On other computers? yep
When does the problem NOT occur?
In the future, I guess
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
Workarounds:
Rotate the image's transform. This is bad.
Pixel offsets won't be subject to rotations from the parent object, so a translation like you're doing will be the only wan to achieve this effect when the issue is taken care of.