Author Topic: Is there a guide for creating custom widgets?  (Read 2177 times)

andrew

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 44
    • View Profile
Is there a guide for creating custom widgets?
« on: August 13, 2013, 12:27:47 PM »
I want to create a custom widget.. one in which the sprite is positioned somewhere on the screen, and then the borders of the sprite are stretched to the edges of the screen.  Sort of the reverse of a sliced sprite.  I've attached an image of what I want to do.  The middle must stay in the sprites position, and the borders must adjust to the edges of the screen.

I've tried a series of sprites with anchors and stretches and there always seems to be some overlap or gap between the sprites, especially when designing in one resolution and then running it on another.

thanks


OnlineCop

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 51
    • View Profile
Re: Is there a guide for creating custom widgets?
« Reply #1 on: August 13, 2013, 12:50:59 PM »
How would you define the borders on the image? Are the borders part of the original source image, or are they "tacked on" at runtime (as in, part of the same sprite atlas as the source image, but made up of a different image)?

If the borders are part of the source image, how would you define the width of the borders? Is it only the outside 1px, or 2px/5px/50px?

andrew

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 44
    • View Profile
Re: Is there a guide for creating custom widgets?
« Reply #2 on: August 13, 2013, 01:11:39 PM »
Well I planned on using the same borders set up for a sliced sprite, and I only need to stretch out the borders to the edges of the screen, so I don't really have to define those in the inspector.

Consider it like a spotlight moving around on the screen (although I'm not planning on it moving)

Thanks
« Last Edit: August 13, 2013, 01:36:19 PM by andrew »

andrew

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 44
    • View Profile
Re: Is there a guide for creating custom widgets?
« Reply #3 on: August 14, 2013, 01:50:05 PM »
So no guide huh?

There was mention of one in the forums, but I couldn't find it.  I'll just look at the sprite code.