Code:
Problem description:
I am trying to come up with a way to offset the map 16 pixels to the right, this will allow for example a 20x11 view to get the full 11 tiles(high), 9.5 tiles to the left and right of the player, then the 1 tile their standing on, effectively centering the player & not be offset by .5 tiles, also this will just allow for them to see that much extra on both sides of them instead of only having the extra visible in one side...this will be helpful when displaying damage values, names, etc... because it has a little extra room to show on each side before it gets cut off(off-screen)
Anyone know if this is possible? I don't want to make the view bigger because then they will see the whole tile on both sides, I want to split the difference & center the map leaving only half the tile visible...
If I make the view size bigger I could I guess use screen objects to block out what's not meant to be visible but if there's a good way to do it, without leaving black borders on the sides or without having to add pretty useless screen objects, I want to use that method instead of the alternatives.
Oct 31 2012, 5:38 am
Best response
|
|
I always thought the player was by default centered in the screen. If not, you can use client.pixel_x/y to offset the view relative to the eye.
|
Thanks that's what I was looking for exactly.
They are always centered in the screen where the tiles are an odd number, it doesn't quite center you otherwise because that would mean more than the set number of tiles specified will technically be visible because half of a tile on the left and right would both be visible at the same time. It tries to keep it strictly to the number of tiles in the view size unless you override it using something like client.pixel_x and client.pixel_y. |