How do I set image position to imagepoint

0 favourites
  • 15 posts
From the Asset Store
Vector illustration of a UFO with an alien in three different positions.
  • generally we can set any image position to its origin but if i add another image point and want to set that as its position

    Is it possible to do this?

    or can we change origin position through events?

  • Are you using an overlapping animated sprite which is set to a sprite with a behavior (e.g. a player box with an animated sprite on top)? If so, then you can reset what that overlapping sprite is going to set as it's X/Y with events. Otherwise, as far as I'm aware, you only have one origin point, which is not subject to change at runtime.

    EDIT: The only possibility is to set frames with different origin points and then shift the frames based on a pre-determined logic.

  • I am already doing this method

    But image is bigger and duplicating them consuming lots of memory

  • I am already doing this method

    But image is bigger and duplicating them consuming lots of memory

    which method? I gave two options

    1) overlapping sprite

    2 )shifting frames with unique origin points

  • second option

    what i did is

    i copied same frame

    positioned different origin to each

  • You could try just setting the position to that imagepoints X & Y

    Now it's origin is sitting at that point, so you can move around that.

  • You could try just setting the position to that imagepoints X & Y

    Now it's origin is sitting at that point, so you can move around that.

    wow! i was never know this kind of this exist

    but still i got 1 problem here

    pressing key sprite is shifting to that position and because we are setting position to new imagepoint

    What if i have more than 2 or 3 or 5 image point then how to control it,?

    i want to animate sprite with these image points

  • luckyrawatlucky you'd need to have some kind of picking method. Without seeing a capx, or knowing more about what you're trying to achieve it's a little hard to give specific help.

  • I want to make this animation with only single frame

    This Character has a background and its jumping their on drum

  • Personally, I wouldn't use image points.

    Well, to be honest I'd just use an animation...

    But if you're set on one frame then you could have an event that runs in order and moves the object to a specific x and y and also sets its angle.

    If you don't mind jumping around like in your GIF you could have a wait inbetween. Or you could setup a bunch of Every Tick events, using lerping to smoothly move. And then trigger the next one when you reach somewhere.

  • As a reeeaaally quick example, heres a CAPX.

    I'm loading a bunch of positions to an array, including angle, then lerping to them and once there I increment a global variable and update the position.

    You could also add in invisible marker sprites with ID's instead of having them in an array.

    You could dynamically define the points in the array.

    You could just use regular animation.

    Any of the above would work <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">

    Anyway, heres the capx https://drive.google.com/open?id=0B5cW0 ... HNiY1drLUk

  • Thank you so much KeeghanM

    This is great a great help

    How can i move bunny continually without stopping at points ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Use something other than the lerp function. The lerp has an "Ease In - Ease Out" effect. I just used it as it was simple to implement.

  • i think litween can work here

    arrays values set to litween target and its done

    i will try this and i will tell if it works

    i will do it tomorrow

    here is late night

  • KeeghanM

    I am getting a problem while editing your capx

    I set lerp towards x to nextBunnyX & y

    you can see what is happening bunny moving quickly from 1st position

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