Author Topic: Is there any way to read the height and /or width of an image?  (Read 5648 times)

playerzero

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Pretty much as the title asks.

I've declared an artwork (wheel art, in this case), and the images are not all the same size, as per what the scraper has pulled.

I need a way to read the size of the images before I manipulate them.

I've tried something like zzzzz = wheelart.height, but it always returns zero

liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 442
    • View Profile
Re: Is there any way to read the height and /or width of an image?
« Reply #1 on: May 24, 2015, 09:53:36 PM »
width and height are the objects set width and height - 0 means it is unscaled.

You want:
texture_width - Get the width of the image texture (in pixels). *** see Notes.
texture_height - Get the height of the image texture (in pixels). *** see Notes.

But you need to look at the notes here about how to use it correctly, as they aren't available immediately:
https://github.com/mickelson/attract/blob/v1.5.0/Layouts.md#ImageNotes