LoginSignup
2
1

More than 5 years have passed since last update.

phina.jsでグリッドに四角形を敷き詰める

Last updated at Posted at 2017-09-04

【phina.js】Gridクラスを使いこなそう - Qiita

みたままなのだけれど。

2017-09-04_16h09_09.png

    var self = this;
      Array.range(1, 16, 1).each((X) =>{
        Array.range(1, 16, 1).each((Y) =>{
          let rect = RectangleShape().addChildTo(self);
          rect.setPosition(self.gridX.span(X),self.gridY.span(Y));
          console.log(rect)
          rect.fill = 'transparent';
          //rect.height /= 1.75;
          rect.width /= 1.75;
      });
    });

横幅小さくしないと重なるもよう。逆に高さはそのままで良さそう。
縦長なのはphina.jsのデフォルトが縦長だから?
むしろ線はもっとピッタリ重なるべきなのだろうか。
周囲に空きがあるのだけれど本当に全領域使っているかはなんか怪しい。
rangeは普通0からじゃないのか?と0スタートにしたら変になったのでどうにもしまらない。

前回

phina.jsで内部が透明な図形を作るには shape.fill = 'transparent' - Qiita

2
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1