How to calculate X/Y offsets for new bitmaps

Questions about how to create your own dungeons and replacement graphics and sounds.

Moderator: George Gilbert

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

How to calculate X/Y offsets for new bitmaps

Post by Gambit37 »

From George Gilbert:

The y-offset for standard (pickupableupable) items / monsters / flooritems is the point in the graphic where the (depth) centre of it would touch the floor. For example, in a walking monster, it would be the centre of it's feet / for a pillar, it's the centre of the base in 3D (which is different from the base in 2D, as that would be the bottom of the image). For most images, the offset is about 3/4 of the height, but obviously depends on the perspective of the objects projection into 2D. The x-offset is ignored.

For wallitems, the offsets are the offsets relative to the centre of the wall (i.e. so an offset of 0,0 would place the item centrally on the wall).

For clouds and spells the offsets are ignored.
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

Hey, GG is the above accurate?

I'm trying to place a full sized viewport image as a flooritem (448x272) and can't seem to get it in the right place no matter what I do. I thought 0,0 would apply in this case? Or 0,272?

After years of fiddling with this, I *still* don't get it!
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

AAAAAAAAAAAAAH!!!

Crucially, I've been reading this wrong all this time, which is why I never understood it!
The y-offset for standard (pickupableupable) items / monsters / flooritems is the point in the graphic where the (depth) centre of it would touch the floor. For example, in a walking monster, it would be the centre of it's feet / for a pillar, it's the centre of the base in 3D (which is different from the base in 2D, as that would be the bottom of the image). For most images, the offset is about 3/4 of the height, but obviously depends on the perspective of the objects projection into 2D.
The 3/4 position is three quarters the height of the image in question. I got confused because GG describes the "centre" of items which suggest its X coordinate, when in fact we're referring to it's Z coordinate.

I always thought it was 3/4 the height of its position within the viewport, which never made any sense.

Duh. Probably obvious to many of you, but it never was to me!
Post Reply