[Gambas-user] RPG Board

Fabien BODARD Gambasfr at ...11...
Sat Aug 23 21:18:42 CEST 2003


Le Samedi 23 Août 2003 04:01, Devilyn a écrit :
> Hello,
> Ok I want to make a tile based board. So I figure I would use a image box
> or picture box. So I figure that if I made a array the size of a small box
> maybe 32X32. with diffrent numbers in it to hold values.. like 1 for tile
> A, 2 for tile B, 3 for tile C. Now I know in Microsoft Visual Basic you use
> the API call BITBLT to cut out one tile at a time out of a tileset like a
> big .bmp file with about 26 tiles in it. In Gambas is it possible or do I
> have to cut all my tiles into peices. So I have 1 tile in each .bmp file.
> Also what do I have to do to put the tiles in a picture box using a array?
> This is just a start for me. If anyone knows or can make a small demo with
> this It would be of a great help. I have no Idea how to paste several
> difftrent tiles into a picture box with gambas. If I can make a small board
> out of several tiles and save the array number deal into a text file it can
> be used in a game that is 2d tile based. but how is it done? Devilyn
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software


You can use an Static array of picture to store it :



Dim TabPic[2] as Picture
Dim GreatPic as Picture
TabPic[0] = Picture["pic1.png"]
TabPic[1] = Picture["pic2.png"]
TabPic[2] = Picture["pic3.png"]

GreatPic.Type = Picture.Pixmap
GreatPic.Resize(96,96)

Draw.Begin(GreatPic)
For j = 0 to 2
	For i = 0 to 2	
		Draw.Picture(TabPic[i], 32*i, 32*j)
	Next
Next

Draw.End

Draw.Begin(ME)
	Draw.Picture(GreatPic, 0, 0)
Draw.End

*****See 'Draw' in the wiki help and 'picture' class

Fabien Bodard




More information about the User mailing list