Author Topic: Sprite manipulation and dragging  (Read 1978 times)

bmannion4

  • Guest
Sprite manipulation and dragging
« on: September 30, 2012, 06:12:50 PM »
What I want to do is:

-Allow the user to drag a sprite(easy enough to attach a collider and drag drop).
-Find the relative location a user clicks the sprite
-If the relative location is near an edge(I can work that math out), then allow the user to resize the texture by dragging(Not sure how to do this).
-If the relative location is not on an edge then the user would just be dragging the sprite.
-Change what texture the sprite is rendering at runtime. Can I do this without having the texture in an atlas?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Sprite manipulation and dragging
« Reply #1 on: September 30, 2012, 07:48:33 PM »
You can if you use a UITexture instead of a UISprite.

For resizing the sprite, that's pretty easy -- adjust its scale (and possibly its position, depending on what side you're on).