Arrow getting too stretched

Get help using Construct 2

Post » Wed Feb 26, 2014 7:13 pm

Message: hopr37 is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
Seen an example on here somewhere had an arrow indicating the power you would use to hit a ball ( like golf only I'm not doing golf)
anyway, when you pulled the arrow, it would stretch but not lose it's shape. I can make it stretch but when i do, it loses it's shape and looks distorted.
Would anyone know how I could accomplish this?
B
7
S
2
Posts: 158
Reputation: 1,021

Post » Wed Feb 26, 2014 11:19 pm

9Patch is the way to go :=)

Set the left margin to the widht of the part you don't want to stretch on the left of the image, the right margin to the width of the part you don't want to stretch on the right of the image, and here you go. Look at this quick example.
You do not have the required permissions to view the files attached to this post.
B
17
S
8
G
4
Posts: 461
Reputation: 6,147

Post » Wed Feb 26, 2014 11:51 pm

@Guizmus 9patch was my first thought, but unfortunately 9patch can't be rotated.
Not sure exactly which example @hopr37 is referring to, but if it's the one I'm thinking off, arrow in that example was rotating to mouse position. But I can be wrong.
ImageImageImageImage
B
157
S
64
G
41
Posts: 2,592
Reputation: 34,644

Post » Thu Feb 27, 2014 6:49 am

@Shinkan

Well, I didn't know that... How is it done then... With 3 sprites and some clever adjusting of the lengths of the middle part ?
I have some hard time finding other ideas than that ^^
B
17
S
8
G
4
Posts: 461
Reputation: 6,147

Post » Thu Feb 27, 2014 8:12 am

Image

One way is to just stretch out the arrows width relative to the distance to the mouse and then multiply the arrows height by the know size difference (so in my case the arrow height is 2/3 of its length)

edit remove link to dropbox and used attachment.
You do not have the required permissions to view the files attached to this post.
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
33
G
47
Posts: 1,194
Reputation: 30,812

Post » Thu Feb 27, 2014 12:51 pm

Thanks for the replies guys. RamPackWobble. not exactly what i was looking for but at least it isn't skewed. I might be able to work with that. thanks.
@Guizmus. you could be right
B
7
S
2
Posts: 158
Reputation: 1,021

Post » Thu Feb 27, 2014 1:27 pm

@hopr37 - try it with the height line disabled, might be closer to what you want (but the arrow will become stretched - which is what I use)
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
33
G
47
Posts: 1,194
Reputation: 30,812

Post » Thu Feb 27, 2014 1:41 pm

basically @gusimus idea but just using two sprites.
You do not have the required permissions to view the files attached to this post.
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
33
G
47
Posts: 1,194
Reputation: 30,812

Post » Thu Feb 27, 2014 9:09 pm

That seems to work pretty well! thanks for the input guys
B
7
S
2
Posts: 158
Reputation: 1,021


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 11 guests