Last post Jul 14, 2020 05:31 PM by mgebhard
Jul 14, 2020 05:08 PM|fazioliamboina|LINK
for game graphics, i made textures from a variable height. i want to simulate them to visually stand on the ground in a html page. so i need them to dock their bottoms to a given Y-axis. The hard part is that the objects do not have a known height.
by default all objects are positioned by their top-left corner. but i do not want this.
i came up with the following solution:
i styled all textures with
it does what i want, but this gives me inaccurate results. the textures are floating in the air, unless i specify a height style that is unknown. the img element is autosized. but the translateY ALWAYS seems to asume the height a little bigger.
i cannot use "position:asbolute; bottom:0px;" , because i would lose the ability for furniture to be placed side by side.
here is an example. The red line at the bottom of the wall, is a DIV. in this div the textures are placed. i use the DIV to tell the textures where the ground is. i gave the div a color, to see it in the test.
Jul 14, 2020 05:31 PM|mgebhard|LINK