How do I stretch and distort a sprite? [SOLVED]

Get help using Construct 2

Post » Tue Oct 28, 2014 12:53 am

hi,

I'm making a "tractor beam" for a space game. As the beam grows (I increase the width) I want it to flare out.

My tractor beam is a long wide rectangle: 100x10

I want one end to become taller i.e. one side to be 100x10 while the other end is say 100x50..

and this whole thing needs to stretched to variable length.. I was looking into a WebGL effect but I couldn't find any I could control like that..

any suggestions?
Last edited by jobel on Tue Oct 28, 2014 3:54 pm, edited 1 time in total.
B
97
S
32
G
15
Posts: 1,194
Reputation: 16,170

Post » Tue Oct 28, 2014 1:41 am

An effect could be made to do it, but I haven't seen any yet. One way to do it is using the Paster Plugin which allows you to specify the corners of a quad to draw on.
plugin-span-class-posthilit-paster-span_p702369?#p702369
B
92
S
32
G
106
Posts: 5,273
Reputation: 69,457

Post » Tue Oct 28, 2014 3:09 am

I think I would draw the beam as you want In one sprite. Then when deployed you increase size from 0,0 at width+10 hight+2 until it hits the object in question. Or what ever growth fits right.
Image
B
26
S
4
G
3
Posts: 147
Reputation: 4,875

Post » Tue Oct 28, 2014 2:25 pm

thanks @R0J0hound ... wow, this is great. I will try this out!

@TonyW that's not a bad idea, so just stretch and maybe add some scale as well..

thanks guys! I will post when I figure out what I'll do...
B
97
S
32
G
15
Posts: 1,194
Reputation: 16,170

Post » Tue Oct 28, 2014 3:51 pm

@TonyW yup that was the easiest way to do it.. thanks..

just like you said I made the full beam like a slight trapezoid and adjusted the height and width without preserving aspect ratio in code as the beam was 'growing' or 'shrinking'.

thanks!
B
97
S
32
G
15
Posts: 1,194
Reputation: 16,170

Post » Wed Oct 29, 2014 4:15 pm

cool! i would love to see the finished project!
Image
B
26
S
4
G
3
Posts: 147
Reputation: 4,875


Return to How do I....?

Who is online

Users browsing this forum: dop2000, namaewayukidesu and 8 guests