HitWidth/HitHeight, Draw*Offset, Hit*Offset, etc, need to be float

OpenZC Development Topics
Post Reply
User avatar
Dimi
Posts: 2
Joined: Sat Feb 08, 2020 11:32 pm

HitWidth/HitHeight, Draw*Offset, Hit*Offset, etc, need to be float

Post by Dimi »

2.55 has a new Scale feature. This scales the tile that a sprite uses. This does not change hit and draw offsets and hit sizes. Obviously, this isn't the problem; functions can be created to do this automatically.

What is the problem is that the maths required to dynamically scale up a sprite along with it's hitboxes requires the hitbox and offsets to store float values. This does not mean that subpixel collision needs to be a thing; these values can (and should) be truncated inengine. However, they DO need to store float values, even if they go unused in the engine, as otherwise functions that scale the hitbox and scale values dynamically will fail to adjust anything at small enough scale percentages, and it makes scaling anything that has already been scaled impossible.

Post Reply