protected void HandleTexturedRect() { switch (FillMode) { default: case UIFillModes.Tilled: ShapeBuffer.TexturedRect(this, Rect, CurrentMaterial.DiffuseTexture, ReverseU, ReverseV); break; case UIFillModes.Stretch: ShapeBuffer.TexturedRect(this, Rect, UVScale, ReverseU, ReverseV); break; case UIFillModes.StretchMiddle: StrechedBuffer.Stretched(this, Rect); break; case UIFillModes.Stretch4Quad: SlicedSprite.FourSlice(this, Rect, CurrentMaterial.DiffuseTexture.PixelSize); break; case UIFillModes.Fill9Sprite: SlicedSprite.NineSlice(this, Rect, CurrentMaterial.DiffuseTexture.PixelSize); break; } }
protected void HandleTexturedRect() { switch (FillMode) { default: // and titled ShapeBuffer.TexturedRect(this, Rect, CurrentMaterial.DiffuseTexture, ReverseU, ReverseV); break; case UIFillModes.Stretch: ShapeBuffer.TexturedRect(this, Rect, UVScale, ReverseU, ReverseV); break; case UIFillModes.StretchMiddle: StrechedBuffer.Stretched(this, Rect); break; case UIFillModes.Stretch4Quad: SlicedSprite.FourSlice(this, Rect, CurrentMaterial.DiffuseTexture.PixelSize); break; case UIFillModes.Fill9Sprite: SlicedSprite.NineSlice(this, Rect, CurrentMaterial.DiffuseTexture.PixelSize); break; case UIFillModes.SmartStprite: if (CurrentMaterial == null || CurrentMaterial.DiffuseTexture == null) { ShapeBuffer.TexturedRect(this, Rect, UVScale, ReverseU, ReverseV); } else { if (CurrentMaterial.DiffuseTexture != null && CurrentMaterial.DiffuseTexture.HasMetaData("9Sprite")) { SlicedSprite.NineSlice(this, Rect, CurrentMaterial.DiffuseTexture.PixelSize); } else { SlicedSprite.FourSlice(this, Rect, CurrentMaterial.DiffuseTexture.PixelSize); } } break; } }