Ignore:
Timestamp:
Feb 1, 2011, 11:07:19 PM (10 years ago)
Author:
sam
Message:

Add an Interface class that displays the general interface.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/monsterz/board.cpp

    r330 r331  
    3535    int2 dim;
    3636    int npieces;
    37     int screen, board, tiles, icons;
     37    int board, tiles, icons;
    3838    int click, whip;
    3939
     
    7878    data->dim = dim;
    7979    data->npieces = npieces;
    80     data->screen = Tiler::Register(PNG_BACKGROUND, 640, 480, 1.0f);
    8180    data->board = Tiler::Register(PNG_BOARD, 384, 384, 1.0f);
    8281    data->tiles = Tiler::Register(PNG_TILES, 48, 48, 1.0f);
     
    105104
    106105    data->scoretext = new Text(NULL, "monsterz/gfx/font2.png");
     106    data->scoretext->SetAlign(Text::ALIGN_RIGHT);
    107107    data->scoretext->SetPos(int3(624, 432, 1));
    108     data->scoretext->SetAlign(Text::ALIGN_RIGHT);
    109108    Ticker::Ref(data->scoretext);
    110109    data->score = 0;
     
    224223    Entity::TickDraw(deltams);
    225224
    226     Scene::GetDefault()->AddTile((data->screen << 16) | 0, 0, 0, 10, 0);
    227     Scene::GetDefault()->AddTile((data->board << 16) | 0, 24, 72, 1, 0);
     225    Scene::GetDefault()->AddTile((data->board << 16) | 0,
     226                                 position.x, position.y, 1, 0);
    228227
    229228    /* Mini monsterz */
     
    232231        int2 p = int2(444, 380 - 28 * n);
    233232        Scene::GetDefault()->AddTile((data->icons << 16) | n, p.x, p.y, 11, 0);
    234     }
    235 
    236     /* Mouse pointer */
    237     if (data->oldmouse.x >= 0 && data->oldmouse.y >= 0)
    238     {
    239         int2 m = data->oldmouse + (int2)(float2)position + int2(-6, 6 - 48);
    240         Scene::GetDefault()->AddTile((data->tiles << 16) | 22, m.x, m.y, 20, 0);
    241233    }
    242234}
     
    550542    Ticker::Unref(data->emitter);
    551543    Tiler::Deregister(data->board);
    552     Tiler::Deregister(data->screen);
    553544    Tiler::Deregister(data->tiles);
    554545    Tiler::Deregister(data->icons);
Note: See TracChangeset for help on using the changeset viewer.