図形描画クラス(軽量アルミとポリカーボネイト)

描画


前回のエントリで使った図形描画クラスで他の素材感も出してみた

import jp.ojos.tools.Shapes;

var rgb = 0x000000;
var rgb2 = 0x666666;
var __width = 200;
var __height = 50;
var __x = 100;
var __y1 = 50;
var __y2 = 150;
var __y3 = 250;



//aqua風

Shapes.drawRoundRect(this, __x, __y1, __width, __height, __height / 2,0x000000,15);
Shapes.drawRoundRect(this, __x + 1, __y1 + 1, __width - 2, __height - 2, (__height - 1) /2,rgb,100);
Shapes.drawRoundRect(this, __x + 1, __y1 + 1, __width - 2, __height - 2, (__height - 1) /2,[0xffffff,0xffffff],[0,100],
{matrixType:"box", x:__x + 1, y:__y1 + 1, w:__width - 2, h:__height - 2, r:(90/180)*Math.PI},"linear",
[130,255]);
Shapes.drawRoundRect(this, __x + (__height - 2) / 4,
__y1 + 1,
__width - (__height - 2) / 2,
(__height - 2) / 2,
(__height - 2) / 4,
[0xffffff,0xffffff],
[100,0],
{matrixType:"box", x:__x + (__height - 2) / 4,
y:__y1 + 1,
w:__width - (__height - 2) / 2,
h:(__height - 2) / 2,
r:(90/180)*Math.PI},"linear");

//メタル風
Shapes.drawRoundRect(this, __x, __y2, __width, __height, __height / 2,0x000000,50);
Shapes.drawRoundRect(this, __x + 2, __y2 + 2, __width - 4, __height - 4, (__height - 2) /2,0xffffff,70);
Shapes.drawRoundRect(this, __x + 2, __y2 + 2, __width - 4, __height - 4, (__height - 2) /2,[0xffffff,0xffffff],[100,0],
{matrixType:"box", x:__x + 2, y:__y2 + 2, w:__width - 4, h:__height - 4, r:(90/180)*Math.PI},"linear",
[0,150]);



//ポリカーボネイト風
Shapes.drawRoundRect(this, __x, __y3, __width, __height, __height / 2,rgb,65);
Shapes.drawRoundRect(this, __x + 2, __y3 + 2, __width - 4, __height - 4, (__height - 2) /2,rgb2,100);
Shapes.drawRoundRect(this, __x + 2, __y3 + 2, __width - 4, __height - 4, (__height - 2) /2,[0xffffff,0xffffff],[70,0],
{matrixType:"box", x:__x + 2, y:__y3 + 2, w:__width - 4, h:__height - 4, r:(90/180)*Math.PI},"linear",
[0,120]);

流行にのってみた。