Problem Description
After loading an external image into a sprite with the option set to resize the sprite to image size you cant get Sprite.Height and Sprite.ImageHeight.
When I output the Sprite.Height it always shows the default value of 177, but all loaded images have sizes of 100, 200 or more pixels.
When I output the Sprite.ImageHeight it always shows 100 even if the loaded image has 200 or more pixels (can't find the reason for this).
The images have this sizes: 1.jpg 100x100 pixel, 2.jpg 100x100 pixel, 3.jpg 100x200 pixel, 4.jpg was a huge screenshot to see if size changes.
The animated sprites seem to resize properly, the screenshot was not streched but Sprite.Height returns 177 (the default value of the TempSprite object placed outside of the layout).
Attach a Capx
Attached
Description of Capx
It loads a banner.txt file containing a list of filenames like 1.jpg|2.jpg|3.jpg... and then creates a loop to create a new sprite for each image.
To be able to position them depending on their height I used a second sprite object (TempSprite) to load the image first and then use Sprite.Height / Sprite.ImageHeight in the Create Sprite action. All Sprites should move from top to bottom with 10px space between them and wrap around at the end (wrap behavior does not seem to work properly if youc reate sprites outside of the layout so I used my own code with position check)
I installed XAMPP (local Apache Server) to test it on localhost. Don't know how to change it so you can reproduce it easily.
relevant code starts in line 19
Observed Result
Sprite.Height and Sprite.ImageHeigt of the TempSprite object is always the same value even if the loaded images have different sizes.
Expected Result
Since "Resize to Image Size" is set in the Load from URL action it should change the sprite size and the new size should be returned.
Affected Browsers
- Chrome: YES
- FireFox: Don't know
- Internet Explorer: YES
Operating System and Service Pack
Windows 8.1 64 Bit
Construct 2 Version ID
r166