A behavior graph had no way to read the pixel size of a picture. An icon sprite with a fixed size therefore stretches every icon that is smaller or larger (an 8x8 pixel-art icon in a 16x16 slot is drawn twice as big).
Done
New data node Texture size: takes a texture, a frame of a texture or a pixel art (sheet or single frame) and hands out width and height in pixels. No or a missing picture gives 0 x 0.
Wired into a sprite's width/height, the picture shows pixel for pixel.
The size comes from the project through GraphLookup.textureSize, the same rule a sprite uses to size itself.
Tests: 2 catalog cases and one test against a real project (pixel-art sheet, single frame, missing texture).
A behavior graph had no way to read the pixel size of a picture. An icon sprite with a fixed size therefore stretches every icon that is smaller or larger (an 8x8 pixel-art icon in a 16x16 slot is drawn twice as big).
## Done
- New data node **`Texture size`**: takes a texture, a frame of a texture or a pixel art (sheet or single frame) and hands out `width` and `height` in pixels. No or a missing picture gives 0 x 0.
- Wired into a sprite's `width`/`height`, the picture shows pixel for pixel.
- The size comes from the project through `GraphLookup.textureSize`, the same rule a sprite uses to size itself.
- Tests: 2 catalog cases and one test against a real project (pixel-art sheet, single frame, missing texture).
Done in ef26004. The data node Texture size hands out width and height of a texture, frame or pixel art (0 x 0 for none). Described on the Behaviors wiki page.
Done in ef26004. The data node `Texture size` hands out `width` and `height` of a texture, frame or pixel art (0 x 0 for none). Described on the Behaviors wiki page.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
A behavior graph had no way to read the pixel size of a picture. An icon sprite with a fixed size therefore stretches every icon that is smaller or larger (an 8x8 pixel-art icon in a 16x16 slot is drawn twice as big).
Done
Texture size: takes a texture, a frame of a texture or a pixel art (sheet or single frame) and hands outwidthandheightin pixels. No or a missing picture gives 0 x 0.width/height, the picture shows pixel for pixel.GraphLookup.textureSize, the same rule a sprite uses to size itself.Done in
ef26004. The data nodeTexture sizehands outwidthandheightof a texture, frame or pixel art (0 x 0 for none). Described on the Behaviors wiki page.