Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- constructor TForm2.TTablero.Create(Panel: TPanel; Filas, Columnas: Integer);
- var
- Fila : Integer;
- Columna : Integer;
- Path : String;
- begin
- // Setear el número de filas y columnas en el tablero
- Self.Filas := Filas;
- Self.Columnas := Columnas;
- SetLength(Board, Filas, Columnas);
- // Reservar espacio para las imágenes de los botones e inicializarlas
- imagenBase := TBitmap.Create;
- imagenAzul := TBitmap.Create;
- imagenRoja := TBitmap.Create;
- Path := ExtractFilePath(Application.ExeName);
- imagenBase.LoadFromFile(Path + 'base.bmp');
- imagenAzul.LoadFromFile(Path + 'azulcirc.bmp');
- imagenRoja.LoadFromFile(Path + 'rojocirc.bmp');
- // Reservar espacio para el tablero de imágenes
- for Fila := 0 to Filas - 1 do begin
- for Columna := 0 to Columnas - 1 do begin
- Board[Fila][Columna] := TCasilla.Create(Panel, Fila, Columna);
- end;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement