Spritefont (Collision)?

Discussion and feedback on Construct 2

Post » Fri May 30, 2014 2:36 am

Just wondering how come its not possible for spritefont to check vs collisions?

Meaning that if you do Spritefont is overlapping some other object?

It can be checked against by other objects and it do have a collision mesh as well. Any particular reason why it doesn't work?
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Post » Fri May 30, 2014 4:29 am

I would love it if it could. Would make making GUI's easier. Same with 9Patch.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,028

Post » Fri May 30, 2014 11:55 am

Touch/mouse works on spritefont+, so I presume it does on the normal plugin as well @jayderu.
A big fan of JavaScript.
B
74
S
20
G
71
Posts: 2,230
Reputation: 44,892

Post » Fri May 30, 2014 2:13 pm

Touch/Mouse really wasn't the need. I found use collisions to determine overlapping to create GUI Panels by pinning objects based on overlap.

Is SpriteFont overlapping 9Patch then Pin SpriteFont to 9Patch.

That way I have easily created GUI panels. Easy for drag/drop, sliding etc. However I have a work around and am not blocked. It would just be more convenient. I also don't use Thirdparty plugins for any low level sharing tools. I use thirdparty plugins for putting together projects. That way if I give out the GUI tool set I know that others will have no need to download a plugin they don't want.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,028

Post » Fri May 30, 2014 2:42 pm

Should be relatively simple to pin your spritefont object to an invisible sprite, set the size of the sprite to the size of your spritefont object and then use the invisible object for the collision checking...
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,583

Post » Fri May 30, 2014 3:07 pm

@BluePhaze. that's kinda a good idea. I've already got everything working, but that's not bad idea to make it even easier and back to the original design.

What I can do is create a sprite for SpriteFont and other non collision widgets in the ES at run time. Compare the collision of the sprite. If overlapping a 9patch sprite collider. Then pin. Good idea. Then I can destroy the colliders once done. Brilliant. Good inspiration there.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,028

Post » Fri May 30, 2014 3:28 pm

Linking it to another sprite should fix it, I was just wondering how come it weren't possible as it have a collision mesh like any other object. But thanks anyway, I was more interested the reason or what things makes spritefonts "special" that it had been decided that it shouldn't work with this.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 18 guests