2016-02-23から1日間の記事一覧

クラスを使う 1

box = class() -- 何も継承せずに box クラスを作る。 function box:init(x, y, w, h, color) -- box クラスを初期化する。 self.x = x self.y = y self.w = w self.h = h self.color = color end function box:paint(gc) -- box クラスの描画メソッドを作る…