Your principle speed bottleneck is not a single trig call, essentially.
In response to Jp
Jp wrote:
Your principle speed bottleneck is not a single trig call, essentially.

Right, I was just posting because I thought the results would be different.
those if statements...please turn them into a switch! please!
In response to Super Saiyan X
Haha yes! I was just getting it out of the hands!
If you need pixel positions, I got pixel positions.

http://www.byond.com/developer/Kaiochao/absolutepositions

Where a tile function would have an x or y, you might want Cx() or Cy(), which give the pixel position of the center of the atom.
You changed this in my library's code:
atom
proc
// The absolute coordinates of this atom's bottom-left corner,
// + a percentage of the atom's dimensions.
Px(Pc) return (x - 1 + Pc) * tile_width()
Py(Pc) return (y - 1 + Pc) * tile_height()

// The absolute coordinates of this atom's center.
Cx() return Px(0.5)
Cy() return Py(0.5)

To this:
atom
proc
// The absolute coordinates of this atom's bottom-left corner,
// + a percentage of the atom's dimensions.
Px(Pc) return (Cx() - 1 + Pc) * tile_width()
Py(Pc) return (Cy() - 1 + Pc) * tile_height()

// The absolute coordinates of this atom's center.
Cx() return Px(0.5)
Cy() return Py(0.5)

which would explain the infinite recursion runtime errors. If you're going to modify a library's code, and especially use Find/Replace, you should at least make a new file.
Where the tile-based functions in FIREking's post have atom.x or y, you would want to use atom.Cx() or Cy() instead, to increase precision. I wouldn't ask you to modify a library's code.
Page: 1 2