Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: How I must know the width & height of the loaded image?  (Read 4621 times)

0 Members and 1 Guest are viewing this topic.

Lion

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 101
    • View Profile
How I must know the width & height of the loaded image?
« 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?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: How I must know the width & height of the loaded image?
« Reply #1 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.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Lion

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 101
    • View Profile
Re: How I must know the width & height of the loaded image?
« Reply #2 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?
Logged

Lion

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 101
    • View Profile
Re: How I must know the width & height of the loaded image?
« Reply #3 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?

Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: How I must know the width & height of the loaded image?
« Reply #4 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.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Lion

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 101
    • View Profile
Re: How I must know the width & height of the loaded image?
« Reply #5 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...
« Last Edit: October 06, 2009, 09:48:13 AM by Lion »
Logged

Lion

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 101
    • View Profile
Re: How I must know the width & height of the loaded image?
« Reply #6 on: October 07, 2009, 12:20:23 PM »

And when will you be able it to add to the WME? Please...
Logged

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1455
  • Lamp dog!
    • View Profile
Re: How I must know the width & height of the loaded image?
« Reply #7 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
« Last Edit: October 14, 2009, 11:56:59 AM by odnorf »
Logged
fl*p
 

Page created in 0.071 seconds with 23 queries.