Arrow getting too stretched

  • 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?

  • 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.

  • 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.

  • 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 ^^

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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.

    you could be right

  • 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)

  • basically idea but just using two sprites.

  • That seems to work pretty well! thanks for the input guys

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)