pixel coordinates for BitmapExpression

If there is something important you think is missing in the current version of ZGameEditor then you can post a feature request here!

Moderator: Moderators

Post Reply
Posts: 4
Joined: Tue Nov 10, 2009 4:47 pm

pixel coordinates for BitmapExpression

Post by shviller » Mon Jul 02, 2012 11:19 pm

Hello guys. Really sorry if this was already discussed (or, hopefully, even implemented), but I'd love two additional variables available inside BitmapExpression.

There are already X and Y that return the current coordinates in the 0..1 range. I'd love to be able to access the actual coordinates of a pixel. That is, for a pixel with X=1.0, Y=1.0 on a 64x128 bitmap, those coordinates will be PX=63, PY=127.

I know that

Code: Select all

int PX = round(X*(16<<BitmapName.Width));
int PY = round(Y*(16<<BitmapName.Height));
but I'm not sure about the whole half pixel offset thing, and I'd very much love to have a shortcut.

The use case is creating lookup textures for complex effects.

Thanks in advance!

Post Reply