Create object at x, y places a sprite at a different location than in the layout at same x,y locatio

0 favourites
  • 3 posts
From the Asset Store
112 High-Quality destruction sounds for videogames
  • Hello,

    I am trying to create a sprite instance using create object sprite_name at (x,y), instead of creating the sprite "manually" in the layout.

    Oddly, although i am using exactly the same coordinates the sprite is placed in a shifted location. Only when i update the x,y coordinates in debug to different numbers do i get the sprite to be in the same location.

    Here are two a screen shorts from the debug windows -- showing the same sprite -- now aligned -- because i had to change the coordinates of the one created with create object.

    Its as if, create object uses a different origin coordinate system.

    Any thoughts why this is are much appreciated.

    (top is the programmatically created, and bottom is the manually created -- both at exactly the same location, but their X and Y are different -- which is odd)

    This is not an unsolveable problem -- a consistent transformation would take care of this -- but, i wonder if its a bug.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Your post doesn't offer too much information, the screenshot doesn't help and there are no events, better to share the project but it's most likely not a bug.

  • Hi,

    Yes you are right.

    I think what caused this behavior was an incorrect animation frame setting I had used after creation, which caused a different image to display with slightly different dimension.

    Also, another issue that occurred, unrelated to above, was that setting a animation frame after setting width and height distorted the image -- changing the sequence, first setting the animation frame and then setting width and height, created the right image.

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