getting angle, hotspot into effect?

Forum for plugin, effect and behavior programmers. Please use the Help & Support forum for help using Construct.

Post » Sat Dec 12, 2009 12:04 am

hello. Many of the effects I've been working on would really benefit from having the angle of the displayed objects.

Also, It seems to me that hotspot is outputting always the center position, instead of the hotspot set in the image editor, am I wrong here?

Try this effect, then rotate the object with it to see the issue.
[url:vd73rhu9]http://octavoarte.cl/Clip%20to%20disk.fx[/url:vd73rhu9]
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Sat Dec 12, 2009 12:14 am

lol that's funky. I see what you mean.

Could it use image points instead?
B
3
S
2
G
3
Posts: 628
Reputation: 2,531

Post » Sat Dec 12, 2009 2:05 am

image points are not available to effects.

only axis-aligned bounding box is (rotated bounding box would be really helpful, too).
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Sat Dec 12, 2009 2:51 am

http://sourceforge.net/apps/mediawiki/c ... el_Shaders

[quote:w90dumg1]float hotspotX; The X co-ordinate of the hotspot of the object with the effect, in texture co-ordinates.
float hotspotY; The Y co-ordinate of the hotspot of the object with the effect, in texture co-ordinates. [/quote:w90dumg1]

Angle isn't available I'm afraid...
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Sat Dec 12, 2009 11:14 pm

you could have an input variable called "angle"
and force the user to "always" FX-Set "angle" to sprite.angle
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Sun Dec 13, 2009 12:32 am

[quote="Ashley":1nvf9x09]http://sourceforge.net/apps/mediawiki/construct/index.php?title=Pixel_Shaders[/quote:1nvf9x09]

Yeah I read that, what I mean is that I based an effect (another version of this one) around the hotspot, so it's centered on it.... and changing the hotspot in the image editor doesn't seem to have any effect.

Are you sure that the correct values for the hotspot are being passed to shaders? it seems to me it's always passing the center.

So about that angle, I guess I'd have to take in an angle via parameters. And get object-space coordinates based on angle parameter, hotspot and pixelwidth/height. screw object size, I guess :s

PS: Just noticed, hotspot coords are being passed correctly on the runtime, just not in the editor!
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665


Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 1 guest