Pixel Movement

by Forum_account
Pixel Movement
A pixel movement library for isometric and top-down maps.
ID:1568930
 
Applies to:
Status: Open

Issue hasn't been assigned a status value.
The default variables bound_* appear to be completely overridden by this library which is not necessary nor desirable behavior.

When bound_x is defined it will reset it back to 0 and reduce pixel_x, which prevents a 1-to-1 view of the object in the map editor (i.e., the position in the map editor and at runtime differ).

I don't know if this is intended behavior or not, nor have I examined in detail if there is a "standard" way for dealing with this situation.

To resolve my problem I modified /atom/movable/New() in pixel-movement.dm and added the following bit at the top:

if (bound_width)
pwidth = bound_width
if (bound_height)
pheight = bound_height

if (bound_x)
step_x += bound_x
if (bound_y)
step_y += bound_y

This corrects provided bound_* variables (if provided) and allows me to work with the library without having to resort to using the px/py/pwidth/pheight variables.

My feature request is to add the above code to the project and/or provide a better workaround.

Note: To allow for backwards compatibility it's probably a good idea to put the above code behind a compile-time flag!