[r119] load image from URL + set frame

Bugs will be moved here once resolved.

Post » Thu Feb 14, 2013 12:28 pm

Link to .capx file (required!):
I can't link a .capx due to the "Cross-origin image load denied by Cross-Origin Resource Sharing policy." error. But it's simple :

Steps to reproduce:
1. Create a sprite with 2 frames.
2. On sprite clicked -> Set frame 1
3. Load image from url keep current size
4. Set frame 0

Observed result:

The size of the final sprite is totaly different from the initial created.

Expected result:

Size is unchanged.

Browsers affected:
Chrome: yes
Firefox: yes


Operating system & service pack:
win7
Construct 2 version:
r118 - r119 ...
B
39
S
15
G
5
Posts: 295
Reputation: 6,089

Post » Thu Feb 14, 2013 3:24 pm

Can you share a .capx anyway? You can request a project file to repro this without cross-origin problems.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Thu Feb 14, 2013 3:38 pm

B
39
S
15
G
5
Posts: 295
Reputation: 6,089

Post » Fri Feb 15, 2013 5:28 pm

That's not quite what I meant, if you import the image as a project file it can load even in preview without any CORS issue. Anyway, it's not a bug: by design changing animation frame keeps the relative scale. Since you choose "keep same size" while loading a much larger image, it means the sprite has scaled itself down much smaller than the animation frame. This overall scale is preserved when switching to other frames. Otherwise the object is effectively resizing itself as it plays the animation. Workaround: explicity set the size using a 'set size' action.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Thu Jul 03, 2014 12:41 am

I changed the Image plugin, and in every Image instantiation I added image.crossOrigin = "anonymous";
this solved the cors problem. I have a suggestion:

put this line in the plugin and enable the export screen to put absolute urls for the images.
B
5
Posts: 11
Reputation: 272


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests