Hotspots with Create Object

This forum is currently in read-only mode.
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • So I'm doing a 'Create Object by Name" and it seems to be ignoring hotspots when I do that, and instead aligning positions in the center, even though the referenced object has a hotspot in the top left. Any way to get around this?

  • What kind of object are you creating?

  • It's a canvas. I have a global object canvas with a Hotspot on the top left. Then I use Create Object by name to make a bunch of them, and when I set the positions of the created ones, it uses the center point instead of the hotspot.

  • That's what I suspected. I've never been able to move the hotspot on a canvas away from the center. I'm not sure they even use hotspots...but don't quote me on that.

    Either they don't use them or it's a bug. For now you can try spawning them at an offset: Self.X + (Self.Width / 2), Self.Y + (Self.Height / 2), would place the top left at the position of the center.

  • Yeah that's what I've been doing, but I don't like the lack of elegance of this since they change width and I have to move them every time. If it's canvas specific then I'll just use a sprite, didn't know it was a canvas-related thing. I'll try sprite and see if it works. Thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I don't like the lack of elegance of this since they change width and I have to move them every time.

    You could always automate this using a function object.

  • It was automated, I just don't like knowing that's how things are working Sprite works great!

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