Change Sprite HotSpot in Runtime

This forum is currently in read-only mode.
From the Asset Store
Antisuspend Plugin
$7.20 USD
20% off
Antisuspend Plugin for Construct 3 prevents the runtime from getting suspended.
  • Is this possible? I don't find any way to do this.

    But if it isn't possible, is there anyway of making it always in the center of the sprite?

    Thanks.

    PS: And is there any way of managing the points in runtime?

  • You can't change imagepoints or hotspots at runtime, however the s plugin has math expressions that are the equivalent of imagepoint rotations, called get offset something or other

    You basically put in the x and y offsets, and the original sprite coordinates and angle, and it tells you the x and y coordinate it would be at rotated at that position.

    If you're going to be resizing there is a little more math.

    Let me know and ill try to get an answer if my job ever let's me leave

  • Sprites can have animation frames with different hotspots,so you can cycle a sprite with your predetermined hotspot

    You can also set up multiple image points for position

    Also numpad 5 will center the hotspot/imagepoint right in the middle

  • Well, I'm creating an aircraft game and the ships are dynamic. They're loaded into the game from a folder and an INI file. So I'm using the Physics Behavior, and the ship is always turned to the mouse position. And so, if I have an image and I have the default image points position, and I need to know what is the point position relatively to the ship's position and angle. Can you give me an exemple/site where it explains the math I need to get this, and also How to totate the ship from it's center?

    And the resizing will be done to create thumbnails of the image to be represented in the "garage".

    Thanks.

  • http://dl.dropbox.com/u/1013446/imgpts.cap

    you'll need the s plugin to run the cap

    http://dl.dropbox.com/u/1013446/Plugins.rar

    if you just want to test it without downloading the plugin here:

    http://dl.dropbox.com/u/1013446/imgpts.exe

    to use double click to add an "imagepoint"

    hold right mouse button to rotate sprite

    the names of the expressions when searching for an expression are Get Rotated X from Offsets and Get Rotated Y from Offsets

    S.xoffrot(origin x, origin angle, x offset, y offset)[/code:21dx10j0]
    and
    [code:21dx10j0]S.yoffrot(origin y, origin angle, x offset, y offset)[/code:21dx10j0]
    for example, you have a sprite called sprite, and you wanted to add an imagepoint at runtime at position  4,5
    S.xoffrot(sprite.x, sprite.angle, 4, 5)
    S.yoffrot(sprite.y, sprite.angle, 4, 5)
    [h2]
    
    other advanced features like being able to stretch the sprite and have the imagepoint stretch,
    or being able to add an imagepoint while the sprite is already rotated and get the correct offsets are both automated through expressions with 's', but not worth posting here, unless you decide you want to work with it.
    
    also, if you fall deeply in love with 's' and decide to dedicate yourself to learning the arcane arts of 's'ness,  there are actions that will automatically generate an array of offsets for you from a an array of sprites, and other weird craziness[/h2]
  • There are expressions for vertex x, and vertex y for a sprites distortmap, but it only returns absolute coords.... I'm wondering if that's a bug, or if it might need a switch to choose relative.

    Any way if that was different would that work just the same as a point?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Can someone give me the S plugin url? I can't find it.

  • Unless I somehow posted the wrong link its in my previous post

    The one that ends in plugins.rar

  • Oops, sorry...

    Thanks for everything, I'll see your example.

  • Hi !

    a few years after 2010 (your post !) i need a plugin to change Hotspot of a sprite during runtime.

    in fact, i want to do a zoom on the point of a sprite i am cliqued.

    can you help me or give me an new url?

    thanks

  • dahu

    Hi !

    a few years after 2010 (your post !) i need a plugin to change Hotspot of a sprite during runtime.

    in fact, i want to do a zoom on the point of a sprite i am cliqued.

    can you help me or give me an new url?

    thanks

    You have bumped a 5 year old thread for the now dead Construct Classic software.

    Was this your intention?

    Your previous posts have been for Construct 2.

  • i haven't seen it was for CC, sorry.

    i search a solution to C2 and i have post an other message to this.

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