Hotspots with Create Object

For questions about using Classic.

Post » Wed May 11, 2011 5:59 am

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?
B
11
S
2
G
3
Posts: 283
Reputation: 1,968

Post » Thu May 12, 2011 2:43 am

What kind of object are you creating?
B
5
S
2
G
5
Posts: 221
Reputation: 2,272

Post » Thu May 12, 2011 2:50 am

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.
B
11
S
2
G
3
Posts: 283
Reputation: 1,968

Post » Thu May 12, 2011 3:04 am

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.
B
5
S
2
G
5
Posts: 221
Reputation: 2,272

Post » Thu May 12, 2011 3:12 am

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.
B
11
S
2
G
3
Posts: 283
Reputation: 1,968

Post » Thu May 12, 2011 3:29 am

[quote="Juryiel":6ucz56k4]I don't like the lack of elegance of this since they change width and I have to move them every time.[/quote:6ucz56k4]
You could always automate this using a function object.
B
5
S
2
G
5
Posts: 221
Reputation: 2,272

Post » Thu May 12, 2011 3:42 am

It was automated, I just don't like knowing that's how things are working :) Sprite works great!
B
11
S
2
G
3
Posts: 283
Reputation: 1,968


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests