R132 Load image from URL - Sprite size bug

  • 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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)