Read the pixel size of a texture in a graph #262

Closed
opened 2026-09-29 06:01:02 +02:00 by meleki · 1 comment
Owner

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).
Author
Owner

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.
admin added this to the Development project 2026-09-29 13:00:21 +02:00
admin moved this to Done in Development on 2026-09-29 13:00:32 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: meleki/feuerwerk#262