R132 Load image from URL - Sprite size bug

Bugs will be moved here once resolved.

Post » Fri Jun 21, 2013 3:28 pm

Link to .capx file (required!):
Link to CAPX
Link to HTML5 example

Steps to reproduce:
1. Create new object - Empty Sprite
2. Use Load image from URL to load i.e. smaller or bigger image than the created one - my example is with 94x94 px image. Set the Size property to Resize to image size.
3. Use the system event to create a new instance of the same sprite object.
4. The new object has the initial size and not the adapted one from the Load image from URL event.

Observed result:
The initial Sprite object is re-sized to image - as expected, but the new one becomes the original sprite size.
Link to HTML5 example

Expected result:
Both Sprites should be the same size.

Browsers affected:
Independent from browser - it is C2 alone

Operating system & service pack:
WinXP SP3

Construct 2 version:
Stable release R132
B
11
S
3
G
3
Posts: 79
Reputation: 3,343

Post » Fri Jun 21, 2013 3:47 pm

Closing, this is not a bug. The 'Resize to image size' option of 'Load image from URL' only affects the first instance, because the second instance has not been created yet; the 'On image URL loaded' only triggers for the first instance as well, because that's the only instance that you loaded a URL for. The second instance is created with the default properties, which is set to use a 256x256 size, and because all sprites share the same images, it uses the same image as the other sprite. Try using 'always set scale to 1' or 'on created: set scale to 1', because nothing you have done will affect the second instance.Ashley2013-06-21 15:47:24
Scirra Founder
B
403
S
238
G
89
Posts: 24,660
Reputation: 196,167

Post » Fri Jun 21, 2013 7:50 pm

OK Ashley, thanks for your response. My expectation was based on the common way the Create Sprite works: once the properties of the Sprite are set, every new instance inherit them.

Anyway I could think of a way around by saving the re-sized first Sprite height and width and re-setting them for every next creation.
B
11
S
3
G
3
Posts: 79
Reputation: 3,343


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 4 guests