Is it possible to change the position of an image point at runtime?

Not favoritedFavorited Favorited 0 favourites
  • 7 posts
From the Asset Store
Connect the dots in the correct order and draw happy animals!
  • When I load a new image to a sprite from URL, the imagepoint is always top left. The sprite also contains other frames with images. All these frames have a centered imagepoint because the sprite will act as a mousecursor.

    The easiest solution is changing the imagepoint of the frame after loading the new image.

    Making a workaround is possible but complex because there are other dependencies.

    Thanks

    Wim

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No, this is not possible. But the origin point should retain its position after loading an image. Say, if it was in the center, it will stay in the center.

  • Hi,

    Thanks for your response!

    What I forgot to mention was that I create a new frame before adding the image to the sprite. A new frame seems to have (0,0) as image point.

    So my question should be: is it possible to create a new frame with a different imagepoint then (0,0)?

    + FileChooser: On changed

    -> spr_load: Add animation frame to "Animation 1" at -1

    -> spr_load: Set animation frame to spr_load.AnimationFrameCount-1

    -> spr_load: Load image from FileChooser.FileURLAt(0) (Resize to image size, cross-origin anonymous)

    When the existing frame has a centered imagepoint, the newly loaded image appears with the left top corner in the center.

    Does it make sense to submit a feature request for this?

    Thanks!

    Wim

  • In the past it was not possible to create new frames in runtime. So if you needed to load 100 images, you had to create 100 empty frames in advance.

    Can you do the same?

  • OK, I could do that if that's the only way. It's not the most elegant solution, but probably the simplest.

    Do you think a feature request has any chance? Or should I not spend time on this because it is too exceptional a situation?

  • Specifying the origin point position when creating new frames is definitely a missing feature. If you post a suggestion, I'll give it an upvote!

    The way Construct references image points is with a number from 0 to 1. For example, (0.5, 0.5) is the center, and (1, 0) is the top-right corner.

  • Feature request submitted:

    github.com/Scirra/Construct-feature-requests/issues/573

    I'm not used to submitting feature requests, so please add comments if you like!

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