Picture Editor: Collision Mask Hotspots

New releases and general discussions.

Post » Sun Mar 07, 2010 9:45 pm

Hi, in the next version could there be a feature that would allow a sprite's collision mask to have its own unique hot spots? In the current version, when you change the sprite's hotspot. The sprite's collsion masks hotspot automatically switches to the sprites hotspot whenever you try to change it.
B
2
G
2
Posts: 10
Reputation: 670

Post » Tue Mar 09, 2010 7:13 am

how and why would this be useful?
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Tue Mar 09, 2010 12:29 pm

Yeah, can't see why it would be useful either. If you absolutely must have different hotspots between the collision and the sprite, you could use containers and invisible collision objects, and give those different hotspots.
B
3
S
2
G
3
Posts: 628
Reputation: 2,531

Post » Wed Mar 10, 2010 1:22 am

It would be useful in making a block in the style of mario that would move up once hit and make an item fall out. Exactly like Madsters Avatar does. If I wanted to make a one of those blocks, I would make a sprite that had an animation that moves its hotspot up once hit, but I don't want to move the collision masks hotspot along with the sprite because that would cause some freaky collision glitch between mario and block if they overlap. It's useful because its convenient and because I don't want to have to make a whole other sprite just for collisions. :wink:
B
2
G
2
Posts: 18
Reputation: 686

Post » Wed Mar 10, 2010 2:18 am

[quote="Viewtiful":dtzqye2r]It would be useful in making a block in the style of mario that would move up once hit and make an item fall out. Exactly like Madsters Avatar does. If I wanted to make a one of those blocks, I would make a sprite that had an animation that moves its hotspot up once hit, but I don't want to move the collision masks hotspot along with the sprite because that would cause some freaky collision glitch between mario and block if they overlap. It's useful because its convenient and because I don't want to have to make a whole other sprite just for collisions. :wink:[/quote:dtzqye2r]
I think you could do that with animation frames. I'll try to draw an illustration below:

|_| 32x32 box with hotspot at 16,16

|_| 32x32 box on top with 32x32 (overall image=32x64) empty space below it and hotspot at 16,48
|_|

That should work. You can do all the animations in the middle (you'd want like 1 or 2), but you just have to remember that the hotspot must remain the same distance from the BOTTOM of the sprite.
B
2
S
2
G
2
Posts: 372
Reputation: 1,794

Post » Wed Mar 10, 2010 2:36 am

I also think that would work but my only problem is, I don't want the empty space, because when you have a transparent space in a sprite it makes selecting objects with the mouse in the layout editor difficult. Its difficult because when you click on a sprite in the layout editor construct does't make distinctions between the visible part of the sprite and the transparent part of the sprite. For example if you have a 300 x 300 sprite that has a small 10 x 10 rectange in the middle and you click on the transparent part of the sprite construct will select the whole object which could cause issues with designing levels. I still think it would be more conveient if sprites and their collision masks have their own individual hotspots. :(
B
2
G
2
Posts: 18
Reputation: 686

Post » Wed Mar 10, 2010 4:16 am

you really really should use a separate object that does the bump. you just make the original invisible, create the proxy, make it bump and then destroy it. Your initial collider won't move and so won't its collision mask, and there won't be any fancy offsetting or weird multiplicity issues.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Wed Mar 10, 2010 4:54 am

[quote="Viewtiful":2pnr1cpv]I also think that would work but my only problem is, I don't want the empty space, because when you have a transparent space in a sprite it makes selecting objects with the mouse in the layout editor difficult. Its difficult because when you click on a sprite in the layout editor construct does't make distinctions between the visible part of the sprite and the transparent part of the sprite. For example if you have a 300 x 300 sprite that has a small 10 x 10 rectange in the middle and you click on the transparent part of the sprite construct will select the whole object which could cause issues with designing levels. I still think it would be more conveient if sprites and their collision masks have their own individual hotspots. :([/quote:2pnr1cpv]
The transparent part would only appear in the animation frames. It would look like a normal 32x32 box the rest of the time, including in the layout window.

Edit: Well, it is only the animation frames that are larger than 32x32. For each frame, you just add the appropiate amount of empty space (in the image frame itself in the image editor) below the sprite (32 pixels by the end of the animation). As long as you keep the hotspot 16 pixels from the bottom (remember it is getting longer), it will work perfectly.
B
2
S
2
G
2
Posts: 372
Reputation: 1,794

Post » Wed Mar 10, 2010 6:21 am

I agree with both of you. Both of your solutions work fine, they just take a more time. The reason I asked for this update is because its just makes this process sooooooo much easier and faster, because I have multiple blocks that the player can hit and each of them would reveal a different item and I didn't want to create seperate objects for each and every one. If this feature never gets implemented into construct I will just have to settle with your advice. I like both of your ideas, but adding this feature would make them more efficient.
B
2
G
2
Posts: 18
Reputation: 686

Post » Wed Mar 10, 2010 3:32 pm

I think making a collision mask's hotspot separate from the sprite would be useful, but for a different reason. Right now if you move the hotspot or crop the mask down smaller than the sprite you get strange collision results.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Next

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 2 guests