148 pic = draw_UseSkinFor(pic);
152 width =
eX * theSize.x;
154 if (theSize.y <= theSize.x * 2)
158 square =
eY * theSize.y * 0.5;
159 bH =
eY * (0.25 * theSize.y / (theSize.x * 2));
160 drawsubpic(theOrigin, square + width, pic,
'0 0 0',
eX + bH, theColor, theAlpha, 0);
161 drawsubpic(theOrigin + square, square + width, pic,
eY - bH,
eX + bH, theColor, theAlpha, 0);
165 square =
eY * theSize.x;
166 drawsubpic(theOrigin, width + square, pic,
'0 0 0',
'1 0.25 0', theColor, theAlpha, 0);
167 drawsubpic(theOrigin + square, theSize - 2 * square, pic,
'0 0.25 0',
'1 0.5 0', theColor, theAlpha, 0);
168 drawsubpic(theOrigin +
height - square, width + square, pic,
'0 0.75 0',
'1 0.25 0', theColor, theAlpha, 0);
184 pic = draw_UseSkinFor(pic);
193 if (theSize.x <= 0 || theSize.y <= 0)
196 if (theBorderSize.x <= 0)
198 if (theBorderSize.y <= 0)
199 drawsubpic(theOrigin, width +
height, pic,
'0.25 0.25 0',
'0.5 0.5 0', theColor, theAlpha, 0);
200 else if (theSize.y <= theBorderSize.y * 2)
203 bH =
eY * (0.25 * theSize.y / (theBorderSize.y * 2));
204 drawsubpic(theOrigin, width +
height * 0.5, pic,
'0.25 0 0',
'0.5 0 0' + bH, theColor, theAlpha, 0);
205 drawsubpic(theOrigin +
height * 0.5, width +
height * 0.5, pic,
'0.25 0 0' +
eY - bH,
'0.5 0 0' + bH, theColor, theAlpha, 0);
209 dY = theBorderSize.y *
eY;
210 drawsubpic(theOrigin, width + dY, pic,
'0.25 0 0',
'0.5 0.25 0', theColor, theAlpha, 0);
211 drawsubpic(theOrigin + dY, width +
height - 2 * dY, pic,
'0.25 0.25 0',
'0.5 0.5 0', theColor, theAlpha, 0);
212 drawsubpic(theOrigin +
height - dY, width + dY, pic,
'0.25 0.75 0',
'0.5 0.25 0', theColor, theAlpha, 0);
215 else if (theSize.x <= theBorderSize.x * 2)
218 bW =
eX * (0.25 * theSize.x / (theBorderSize.x * 2));
219 if (theBorderSize.y <= 0)
221 drawsubpic(theOrigin, width * 0.5 +
height, pic,
'0 0.25 0',
'0 0.5 0' + bW, theColor, theAlpha, 0);
222 drawsubpic(theOrigin + width * 0.5, width * 0.5 +
height, pic,
'0 0.25 0' +
eX - bW,
'0 0.5 0' + bW, theColor, theAlpha, 0);
224 else if (theSize.y <= theBorderSize.y * 2)
227 bH =
eY * (0.25 * theSize.y / (theBorderSize.y * 2));
228 drawsubpic(theOrigin, width * 0.5 +
height * 0.5, pic,
'0 0 0', bW + bH, theColor, theAlpha, 0);
229 drawsubpic(theOrigin + width * 0.5, width * 0.5 +
height * 0.5, pic,
eX - bW, bW + bH, theColor, theAlpha, 0);
231 drawsubpic(theOrigin + theSize * 0.5, width * 0.5 +
height * 0.5, pic,
eX +
eY - bW - bH, bW + bH, theColor, theAlpha, 0);
235 dY = theBorderSize.y *
eY;
236 drawsubpic(theOrigin, width * 0.5 + dY, pic,
'0 0 0',
'0 0.25 0' + bW, theColor, theAlpha, 0);
237 drawsubpic(theOrigin + width * 0.5, width * 0.5 + dY, pic,
'0 0 0' +
eX - bW,
'0 0.25 0' + bW, theColor, theAlpha, 0);
238 drawsubpic(theOrigin + dY, width * 0.5 +
height - 2 * dY, pic,
'0 0.25 0',
'0 0.5 0' + bW, theColor, theAlpha, 0);
239 drawsubpic(theOrigin + width * 0.5 + dY, width * 0.5 +
height - 2 * dY, pic,
'0 0.25 0' +
eX - bW,
'0 0.5 0' + bW, theColor, theAlpha, 0);
240 drawsubpic(theOrigin +
height - dY, width * 0.5 + dY, pic,
'0 0.75 0',
'0 0.25 0' + bW, theColor, theAlpha, 0);
241 drawsubpic(theOrigin + width * 0.5 +
height - dY, width * 0.5 + dY, pic,
'0 0.75 0' +
eX - bW,
'0 0.25 0' + bW, theColor, theAlpha, 0);
246 if (theBorderSize.y <= 0)
248 dX = theBorderSize.x *
eX;
249 drawsubpic(theOrigin, dX +
height, pic,
'0 0.25 0',
'0.25 0.5 0', theColor, theAlpha, 0);
250 drawsubpic(theOrigin + dX, width - 2 * dX +
height, pic,
'0.25 0.25 0',
'0.5 0.5 0', theColor, theAlpha, 0);
251 drawsubpic(theOrigin + width - dX, dX +
height, pic,
'0.75 0.25 0',
'0.25 0.5 0', theColor, theAlpha, 0);
253 else if (theSize.y <= theBorderSize.y * 2)
256 bH =
eY * (0.25 * theSize.y / (theBorderSize.y * 2));
257 dX = theBorderSize.x *
eX;
258 drawsubpic(theOrigin, dX +
height * 0.5, pic,
'0 0 0',
'0.25 0 0' + bH, theColor, theAlpha, 0);
259 drawsubpic(theOrigin + dX, width - 2 * dX +
height * 0.5, pic,
'0.25 0 0',
'0.5 0 0' + bH, theColor, theAlpha, 0);
260 drawsubpic(theOrigin + width - dX, dX +
height * 0.5, pic,
'0.75 0 0',
'0.25 0 0' + bH, theColor, theAlpha, 0);
261 drawsubpic(theOrigin +
height * 0.5, dX +
height * 0.5, pic,
'0 0 0' +
eY - bH,
'0.25 0 0' + bH, theColor, theAlpha, 0);
262 drawsubpic(theOrigin + dX +
height * 0.5, width - 2 * dX +
height * 0.5, pic,
'0.25 0 0' +
eY - bH,
'0.5 0 0' + bH, theColor, theAlpha, 0);
263 drawsubpic(theOrigin + width - dX +
height * 0.5, dX +
height * 0.5, pic,
'0.75 0 0' +
eY - bH,
'0.25 0 0' + bH, theColor, theAlpha, 0);
267 dX = theBorderSize.x *
eX;
268 dY = theBorderSize.y *
eY;
269 drawsubpic(theOrigin, dX + dY, pic,
'0 0 0',
'0.25 0.25 0', theColor, theAlpha, 0);
270 drawsubpic(theOrigin + dX, width - 2 * dX + dY, pic,
'0.25 0 0',
'0.5 0.25 0', theColor, theAlpha, 0);
271 drawsubpic(theOrigin + width - dX, dX + dY, pic,
'0.75 0 0',
'0.25 0.25 0', theColor, theAlpha, 0);
272 drawsubpic(theOrigin + dY, dX +
height - 2 * dY, pic,
'0 0.25 0',
'0.25 0.5 0', theColor, theAlpha, 0);
273 drawsubpic(theOrigin + dY + dX, width - 2 * dX +
height - 2 * dY, pic,
'0.25 0.25 0',
'0.5 0.5 0', theColor, theAlpha, 0);
274 drawsubpic(theOrigin + dY + width - dX, dX +
height - 2 * dY, pic,
'0.75 0.25 0',
'0.25 0.5 0', theColor, theAlpha, 0);
275 drawsubpic(theOrigin +
height - dY, dX + dY, pic,
'0 0.75 0',
'0.25 0.25 0', theColor, theAlpha, 0);
276 drawsubpic(theOrigin +
height - dY + dX, width - 2 * dX + dY, pic,
'0.25 0.75 0',
'0.5 0.25 0', theColor, theAlpha, 0);
277 drawsubpic(theOrigin +
height - dY + width - dX, dX + dY, pic,
'0.75 0.75 0',
'0.25 0.25 0', theColor, theAlpha, 0);