Jump to content

dabrorius

Members
  • Posts

    5
  • Joined

  • Last visited

Contact Methods

  • Twitter
    fDefar

Recent Profile Visitors

531 profile views

dabrorius's Achievements

  1. I just used pure JS in the end. Thanks everybody. Here's the code if anyone finds this topic later. var img = new Image();img.onload = function() { alert(this.width + 'x' + this.height);}img.src = 'http://www.google.com/intl/en_ALL/images/logo.gif';
  2. Thanks, that worked! But, I just noticed that getSize() on texture does not return size of an image, it returns size of a texture which is always a power of two (512x512, 512x1024 etc.)
  3. Well isReady() method is ok but then I have to poll it every X milliseconds and check if it has loaded, I would expect there to be a callback function since it's javascript after all. Well this is also an option for sure, but I'm just troubled by finding the width/height of the image currently.
  4. Hi Wingnut Thanks a lot for a very detailed explanation, I actually understood most of the stuff already but I just missed the getSize() method. Now the only problem left is that if I call getSize() immediately after creating the texture I get width and height 0. I guess that's because image wasn't loaded yet. Is there's some kind of callback method that I can pass, for example "onTextureLoad" or something?
  5. Hi, I'm trying to load a photo as a texture on to a piece of a (square) mesh. The problem is that original photo is not square so I need to somehow figure out aspect ratio of it so I can modify the mesh to fit it. What's the best way to do it? I can fetch the image via url using pure JS but that does not seem right and introduces some problems because that request is asynchronous. Any suggestion?
×
×
  • Create New...