GameView -

basil99

Active Member
Licensed User
Longtime User
GameView - SORTED, my fault

Hi!

Task is to build grafical menu system within Gameview
I have an array of images:

Dim Menuitems As Int: Menuitems = XXX 'XXX - some value
Dim MenuImages( MenuItems ) As String
Dim MenuButtons( MenuItems ) As BitmapData

Dim MenuItemX( MenuItems ) As Int 'X position on screen
Dim MenuItemY( MenuItems ) As Int 'Y position on screen
Dim MenuItemWidth( MenuItems ) As Int
Dim MenuItemHeight( MenuItems ) As Int


I load them in the following way:

For i = 0 To MenuItems - 1

MenuButtons( i ).Bitmap = LoadBitmap( File.DirAssets, MenuImages( i ) )

Next


Loading seems to be successfull, because i can calculate all images width/height.

Later, I try to add them to the Gameview:

gv.BitmapsData.Clear

For i = 0 To MenuItems - 1

MenuButtons( i ).DestRect.Initialize( MenuItemX(i), MenuItemY(i), MenuItemX(i) + MenuItemWidth(i), MenuItemY(i) + MenuItemHeight(i) )

gv.BitmapsData.Add( MenuButtons( i ).Bitmap )

Next


No bugs from B4A, but device report am error ( unexpected programm termination ) at this line gv.BitmapsData.Add( MenuButtons( i ).Bitmap )


Where is the bug ?
Thank you

EDIT:
Found error, correct is

gv.BitmapsData.Add( MenuButtons( i ) )

Thread may be deleted
 
Last edited:
Top