Basic documentation
Anyway here is basic usage of that library:
1) Add library functionalities.
using AllegroNET;
2) Create BITMAP for our game and link it with GameScreen. GameScreen is Silverlight Image where we want to output our graphics. We are using WriteableBitmap internally here - look for 'true' argument in calling create_bitmap). In most cases you will need only one such bitmap - main bitmap that will handle all changes. Rest bitmaps can be created via simplified version: create_bitmap(w, h).
BITMAP screen = Allegro.create_bitmap((int)GameScreen.Width, (int)GameScreen.Height, true); GameScreen.Source = screen.Source;
3) Clear bitmap with white color (0xffffff), if you need (default color is black):
Allegro.clear_to_color(color, 0xffffff);
4) Let's draw some primitives, for example:
Allegro.circle(screen, 100, 100, 50, 0xffff00); Allegro.triangle(screen, 100, 100, 300, 100, 150, 50, 0x0000ff);
Allegro.draw_sprite(screen, sprite, 100, 100);6) Let's use DATAFILE. To create DATAFILE you can use grabber utility from original Allegro.
6.1) Init storage
Allegro.init_file_storage(Allegro.FileStorageType.ApplicationStorage);6.2) Load DATAFILE
DATAFILE[] dat = Allegro.load_datafile("melee.dat");6.3) Load RLE_SPRITE from DATAFILE
RLE_SPRITE rle = null; if (dat != null) rle = (RLE_SPRITE)dat[0].dat;
screen.Source.Invalidate();