Author Topic: sliced and filled sprite  (Read 6888 times)

jingato

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
sliced and filled sprite
« on: May 22, 2013, 04:41:22 PM »
Hi, I was wondering if there was any way to have a sprite that was both a sliced sprite and filled so that a sliced sprite could have part of it masked off. What Im trying to do is have a sliced sprite but only show the right half of it.

Thanks!

Tranas

  • Guest
Re: sliced and filled sprite
« Reply #1 on: May 22, 2013, 05:04:07 PM »
Investigate NGUI's "Progress Bar" widget.
It combines sliced sprites with a slider that allows you to manipulate how much of the sprite is shown by shrinking it.

If that isn't exactly what you're looking for, create a new panel and put a sliced sprite under it.
Set the panel to clipping: Hard Clip.
This will allow you to set-up a rectangle mask for the sprite.

There's a tutorial about clipping as well.

If I understand your question, that might be good places to look.

jingato

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
Re: sliced and filled sprite
« Reply #2 on: May 23, 2013, 04:28:15 PM »
Thank you for the reply,

unfortunately the progress bar is not what I'm looking for, that is basically like a regular sliced sprite. The sliced sprite has a black border so I want to mask off one half without showing the border, but keep it on the other half.

I'll look up the clipping tutorial you mentioned. I don't want to use an additional panel because I dont want to have another draw call. I was looking into extending slicedSprite and adding the same functionality as the filled sprite, but I couldn't get it to work.

Thanks