Wintermute Engine Forum

Wintermute Engine => Bug reports => Topic started by: Lion on October 02, 2009, 11:32:35 AM

Title: How I must know the width & height of the loaded image?
Post by: Lion on October 02, 2009, 11:32:35 AM
I create a window with a static object:

WINDOW
{
  X = 0
  Y = 0
  WIDTH = 1024
  HEIGHT = 768

  STATIC
  {
    NAME = "Background"
    X = 512
    Y = 320
  }
}

Then in a script I use the function SetImage() for static object.

How I must know the width & height of the loaded image?
Title: Re: How I must know the width & height of the loaded image?
Post by: Mnemonic on October 03, 2009, 05:23:45 PM
You can't, I'm afraid. The static control size is independent on the image size. And there's currently no way of querying sprite frame dimensions from script.
Title: Re: How I must know the width & height of the loaded image?
Post by: Lion on October 05, 2009, 09:54:29 AM
Do I can to use the function SizeToFit() of static object?
// Changes the size of the control to fit the contained text or image.

I after to know a width and height of static object? Is it possible so to do?
Title: Re: How I must know the width & height of the loaded image?
Post by: Lion on October 05, 2009, 01:59:43 PM
SizeToFit() with images does not work. It is although written in a help:

Changes the size of the control to fit the contained text or image.

Why?

Title: Re: How I must know the width & height of the loaded image?
Post by: Mnemonic on October 05, 2009, 05:39:37 PM
Why? I don't know, must have been drunk when writing the docs. Or the code. Or both.

Seriously, it's an omission.
Title: Re: How I must know the width & height of the loaded image?
Post by: Lion on October 06, 2009, 09:15:56 AM
Is it possible to do that SizeToFit() function worked and for images?
As it is written in a wme.chm.

It is very necessary...
Title: Re: How I must know the width & height of the loaded image?
Post by: Lion on October 07, 2009, 12:20:23 PM
And when will you be able it to add to the WME? Please...
Title: Re: How I must know the width & height of the loaded image?
Post by: odnorf on October 07, 2009, 01:14:52 PM
The feature request has been noted. As wme is a hobby project the answer to all feature requests is "When -and if- it's done(tm)". Also wme is opensource so people are encouraged to add their own features and submit the code under the same license (lgpl).

EDIT: silly typo