It depends on if you want the background resizable and how. Buttons will typically be different sizes, so this is more important.
You can think of a RectangleStyle as having nine sections.
123 1 is NorthWest
456 5 is Center
789 8 is South
The most simple way to create a RectangleStyle is to define section 5 and tell it to expand/shrink the entire ImageStyle.
The most complex way would be to define all nine sections with separate ImageStyles. Each ImageStyle can have the same Source DDS but different SourceRects.
Say you had a 12x9 image depicting a button. The button's image had a 1px border around the perimeter.
If you only defined section 5(Center) and you applied the RectangleStyle to a 120x90 button, the 1px border would be stretched to a 10px border. This would look pretty bad.
If you define all nine sections, you can say the SourceRect of #1 is "0,0,1,1", #2 is "1,0,11,1", #3 is "11,0,12,1". This will cause the two corners to always be a 1x1px image. The top edge(2/North) will always be 1px high but expand to be 118px if needed(and NorthStretch is set to true).
I might be rusty on creating SourceRects... so the above examples might be slightly off.
Last edited by EQAditu : 03-13-2010 at 05:33 PM.
|