First off, I am a beginner so go easy
Now I'm going through the tutorials of the GameView library since it seems easier for a beginner when dealing with Bitmaps and such associated with game creation. Now my question deals with loading a BACKGROUND into the GameView and making it scroll.
I get it to the background to show by declaring the variable in Process_Globals as so:
and then in the Activity_Create:
Now my problem is that if I declare the variable as a bitmap instead of a BitmapData then I don't have the member SrcRect which is required to move the image and if I declare it as a BitmapData and use the following code:
I get an error that says the SetBackgroundImage was expecting a Bitmap but found BitmapData...
OR
If I use these lines I get a crash when launching
Any ideas? Is there a limit to what can be initialized at once? Like I said I am really green to using GameView...
Now I'm going through the tutorials of the GameView library since it seems easier for a beginner when dealing with Bitmaps and such associated with game creation. Now my question deals with loading a BACKGROUND into the GameView and making it scroll.
I get it to the background to show by declaring the variable in Process_Globals as so:
B4X:
Dim space as Bitmap
and then in the Activity_Create:
B4X:
space.Initialize(File.DirAssets, "space.png")
gv.SetBackgroundImage(space)
Now my problem is that if I declare the variable as a bitmap instead of a BitmapData then I don't have the member SrcRect which is required to move the image and if I declare it as a BitmapData and use the following code:
B4X:
space.Bitmap = LoadBitmap(File.DirAssets, "space.png")
gv.SetBackgroundImage(space)
I get an error that says the SetBackgroundImage was expecting a Bitmap but found BitmapData...
OR
If I use these lines I get a crash when launching
B4X:
space.Bitmap.Initialize(File.DirAssets, "space.png")
'space.Bitmap = LoadBitmap(File.DirAssets, "space.png") <---Doesn't work either
gv.SetBackgroundImage(space)
Any ideas? Is there a limit to what can be initialized at once? Like I said I am really green to using GameView...