Change size of a button?


(Adam Edney) #1

I’m making a button class, but is there a way to change the size of a image, so I can create a image any size I want. It doesn’t have to be a image, im not sure if there texture atlas in FP. or something which is it similar.

So my question would be what is the best way of making a button which can be any size I wanted it to be, without having a image for just that size?

If you done something like that before than i would love to know the answer.


(David Williams) #2

9-slicing may be what you’re thinking of.


(Adam Edney) #3

Thanks for the reply, im assuming that you are talking about this http://pastebin.com/M2zEwin8

How do you use it, for example, lets say i have a image which is 10 by 10 and it has a border of 1 around it, how do i stretch it around 8 by 8 box inside the image . or is there some documentation on how to use it, but still thanks for the help


(David Williams) #4

I’ve never actually used any 9-slicing, but it looks like that class is specifically made for flashpunk. Neat! Here’s another class. Like I said, I have no prior experience. http://www.bytearray.org/?p=118