UDB Visual Mode: Things Rendering Outside Bounding Boxes

Wed Sep 22, 2021 4:06 pm

I've created a brand new configuration file that contains two Things for testing. Everything is working well except that the Things are not rendered within their bounding boxes in the Visual Mode:

Things Bounding Box Weirdness.png


Initially, the bounding boxes are aligned with the floor and the sprites are hidden beneath the floor; I manually elevated the Things so that the sprites would be shown.

Can anyone suggest why this might occur, or which aspect of the configuration file is responsible? It seems like the renderer is assuming that the pivot point of the sprite is the top-left corner, rather than the bottom middle, but I can't find any examples of how to configure this.

Here is the definition of my thingstypes:

Code:
thingtypes
{
   health
   {
      color = 1;   // Blue
      arrow = 0;
      title = "Health and Armour";
      sort = 1;
      hangs = 0;
      blocking = 0;
      width = 20;

      1
      {
         title = "Stimpack";
         sprite = "stimpack";
         class = "Stimpack";
         height = 16;
      }

      2
      {
         title = "Medikit";
         sprite = "medikit";
         class = "Medikit";
         height = 25;
      }
   }
}


In case it is relevant, both sprite images are PNG files in a file-system directory; I am not using a WAD / PK3 / ZIP.

Also, what is the purpose of the 'height' attribute of a thing? Can't this be calculated automatically from the width and the aspect ratio of the image?

Thanks in advance.
You do not have the required permissions to view the files attached to this post.

Re: UDB Visual Mode: Things Rendering Outside Bounding Boxes

Wed Sep 22, 2021 10:39 pm

You need to set the image's offset. You can do that in SLADE.

the image size and the thing size are completely independent from one another. Good examples for that are the Revenant and most decorations.

Re: UDB Visual Mode: Things Rendering Outside Bounding Boxes

Thu Sep 23, 2021 1:28 am

This may be of interest: viewtopic.php?f=39&t=56521 (Sprite alignment information.)

Re: UDB Visual Mode: Things Rendering Outside Bounding Boxes

Thu Sep 23, 2021 1:41 am

Thanks very much; I hadn't found any reference to the sprite image offsets elsewhere.