Advertisement
fslasht

Untitled

May 17th, 2011
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.03 KB | None | 0 0
  1.     // ● テクスチャ
  2.     public enum Texture  {
  3.         // テクスチャ定数
  4.         Player(R.drawable.actor5),
  5.         Enemy01(R.drawable.enemy01),
  6.         BG01(R.drawable.town01_a),
  7.         MAP01(R.drawable.map02);
  8.  
  9.  
  10.         // カスタムメソット・メンバー
  11.         public int id_;     // 識別ID (リソース番号)
  12.         public int x_;          // 巨大テクスチャ上でのX位置
  13.         public int y_;          // 巨大テクスチャ上でのY位置
  14.         public int w_;          // テクスチャ全体の幅
  15.         public int h_;          // テクスチャ全体の高さ
  16.         public int w1_;     // 1パターンの幅
  17.         public int h1_;     // 1パターンの高さ
  18.         public int xnum_;       // パターン数 (縦に並べる)
  19.         public int ynum_;       // アニメーション数(横に並べる)
  20.  
  21.         Texture(int id,int w1, int h1) {
  22.             init(id,w1,h1);
  23.         }
  24.         Texture(int id) {
  25.             init(id,0,0);
  26.         }
  27.         void init(int id,int w1, int h1) {
  28.             id_ = id;
  29.             x_ = 0;
  30.             y_ = 0;
  31.             w_ = w1_ =w1;
  32.             h_ = h_ = h1;
  33.             xnum_ = 1;
  34.             ynum_ = 1;
  35.         }
  36.         public int getID() {
  37.             return id_;
  38.         }
  39.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement