B basil99 Active Member Licensed User Longtime User Feb 26, 2013 #1 Lets say, I load several images and add them to Gameview in this way Dim gv as GameView and gv.BitmapsData.Add( Picture1 ) gv.BitmapsData.Add( Picture2 ) gv.BitmapsData.Add( Picture3 ) gv.BitmapsData.Add( Picture4 ) ....... gv.BitmapsData.Add( PictureN ) Then I need to "clear" Gameview and start to draw another pack of pictures: gv.BitmapsData.Add( anotherPicture1 ) gv.BitmapsData.Add( anotherPicture2 ) gv.BitmapsData.Add( anotherPicture3 ) ....... gv.BitmapsData.Add( anotherPictureM ) So, questions are: 1) how to "clear" GameView "in one click" ? If possible ? 2) If not, I need to make calls like that: Picture1.Delete = True Picture2.Delete = True Picture3.Delete = True ................ PictureN.Delete = True then add another group of pictures ? I tried this but by some reason I can't add picture to the gameview again if it was deleted before - nothing is displayed 3) How to remove picture from gameview list without deleting it ? Thank you Last edited: Feb 26, 2013
Lets say, I load several images and add them to Gameview in this way Dim gv as GameView and gv.BitmapsData.Add( Picture1 ) gv.BitmapsData.Add( Picture2 ) gv.BitmapsData.Add( Picture3 ) gv.BitmapsData.Add( Picture4 ) ....... gv.BitmapsData.Add( PictureN ) Then I need to "clear" Gameview and start to draw another pack of pictures: gv.BitmapsData.Add( anotherPicture1 ) gv.BitmapsData.Add( anotherPicture2 ) gv.BitmapsData.Add( anotherPicture3 ) ....... gv.BitmapsData.Add( anotherPictureM ) So, questions are: 1) how to "clear" GameView "in one click" ? If possible ? 2) If not, I need to make calls like that: Picture1.Delete = True Picture2.Delete = True Picture3.Delete = True ................ PictureN.Delete = True then add another group of pictures ? I tried this but by some reason I can't add picture to the gameview again if it was deleted before - nothing is displayed 3) How to remove picture from gameview list without deleting it ? Thank you
Erel B4X founder Staff member Licensed User Longtime User Feb 26, 2013 #2 1, 2) Code: Copy gv.BitmapsData.Clear 3) Setting Delete to true is equivalent to removing the picture. It doesn't "destroy" the image. It is convenient to set Delete to true and not modify the list directly. Modifying the list directly can lead to parent For Next blocks to fail. Upvote 0
1, 2) Code: Copy gv.BitmapsData.Clear 3) Setting Delete to true is equivalent to removing the picture. It doesn't "destroy" the image. It is convenient to set Delete to true and not modify the list directly. Modifying the list directly can lead to parent For Next blocks to fail.
B basil99 Active Member Licensed User Longtime User Feb 27, 2013 #3 Erel said: 1, 2) Code: Copy gv.BitmapsData.Clear 3) Setting Delete to true is equivalent to removing the picture. It doesn't "destroy" the image. It is convenient to set Delete to true and not modify the list directly. Modifying the list directly can lead to parent For Next blocks to fail. Click to expand... Ok, thanks, it works ) Upvote 0
Erel said: 1, 2) Code: Copy gv.BitmapsData.Clear 3) Setting Delete to true is equivalent to removing the picture. It doesn't "destroy" the image. It is convenient to set Delete to true and not modify the list directly. Modifying the list directly can lead to parent For Next blocks to fail. Click to expand... Ok, thanks, it works )
Juan Luis Lopez Member Licensed User Longtime User Mar 5, 2014 #4 i want to make something to blink but if i use .delete = true and then use .delete= false nothing appears i tries to reload the bitmap with bitmapdata.loadbitmap but i doesnt work... how can i do it? Upvote 0
i want to make something to blink but if i use .delete = true and then use .delete= false nothing appears i tries to reload the bitmap with bitmapdata.loadbitmap but i doesnt work... how can i do it?
Erel B4X founder Staff member Licensed User Longtime User Mar 5, 2014 #5 It is better to start a new thread for a new question. You can remove the BitmapData from the last and later add it. Upvote 0
It is better to start a new thread for a new question. You can remove the BitmapData from the last and later add it.
Informatix Expert Licensed User Longtime User Mar 5, 2014 #6 Juan Luis Lopez said: i want to make something to blink but if i use .delete = true and then use .delete= false nothing appears i tries to reload the bitmap with bitmapdata.loadbitmap but i doesnt work... how can i do it? Click to expand... Blinking effect is done by changing the alpha value (from 0 to 255, alternatively), not by creating/removing images. Upvote 0
Juan Luis Lopez said: i want to make something to blink but if i use .delete = true and then use .delete= false nothing appears i tries to reload the bitmap with bitmapdata.loadbitmap but i doesnt work... how can i do it? Click to expand... Blinking effect is done by changing the alpha value (from 0 to 255, alternatively), not by creating/removing images.
Juan Luis Lopez Member Licensed User Longtime User Mar 5, 2014 #7 but bitmapdata hasnt an alpha property... i found a way to do that after deleting with bitmapdata.delete=true, i have to reload a bitmap and add it to the gameview list. i have been reading about accelerated surface and dxlib but i found it hard. thanks! Upvote 0
but bitmapdata hasnt an alpha property... i found a way to do that after deleting with bitmapdata.delete=true, i have to reload a bitmap and add it to the gameview list. i have been reading about accelerated surface and dxlib but i found it hard. thanks!
Informatix Expert Licensed User Longtime User Mar 6, 2014 #8 Juan Luis Lopez said: but bitmapdata hasnt an alpha property... Click to expand... Your bitmapdata has a bitmap property containing the image to make blink. Use the AlterColors function of my Accelerated Surface library (or any similar function of another library) to change the alpha value. EDIT: another way is to draw with a zero size destrect if the library allows that (untested). That's not ideal but it's better than creating/removing an object repeatedly. Upvote 0
Juan Luis Lopez said: but bitmapdata hasnt an alpha property... Click to expand... Your bitmapdata has a bitmap property containing the image to make blink. Use the AlterColors function of my Accelerated Surface library (or any similar function of another library) to change the alpha value. EDIT: another way is to draw with a zero size destrect if the library allows that (untested). That's not ideal but it's better than creating/removing an object repeatedly.