01-21-2023, 10:54 AM
@TerryRithie
too late,
LOL, Your code work well on Windows 11 64 bit and QB64 2.0.2 and QB64PE 3.4.1
@Bplus
I have saved your stars and used in the collision demo...
I find an issue: the width and the height of the image is taken from the whole sprite and not for the dimensions of the star!
(all that black area is used like piece of image and not as transparent color! In other words the background of an image covers the other image when they overlaps.)
So I have thought that we must set black color (the background color of these images) as transparent before to make the Mask using TerryRitchie tool.
adding these two lines of code before calling MakeMask subroutine, we got it!
but when we run the code we get another issue about the collisions: the function returns a collision also if there no is.
The result is the same also if we set to transparency the background color taken directly from the loaded images
as for example this code does
so it needs further investigations about what happens with masks.
too late,
LOL, Your code work well on Windows 11 64 bit and QB64 2.0.2 and QB64PE 3.4.1
@Bplus
I have saved your stars and used in the collision demo...
I find an issue: the width and the height of the image is taken from the whole sprite and not for the dimensions of the star!
(all that black area is used like piece of image and not as transparent color! In other words the background of an image covers the other image when they overlaps.)
So I have thought that we must set black color (the background color of these images) as transparent before to make the Mask using TerryRitchie tool.
adding these two lines of code before calling MakeMask subroutine, we got it!
Code: (Select All)
_SetAlpha 0, _RGB32(0), RedOval.image
_SetAlpha 0, _RGB32(0), GreenOval.image
but when we run the code we get another issue about the collisions: the function returns a collision also if there no is.
The result is the same also if we set to transparency the background color taken directly from the loaded images
as for example this code does
Code: (Select All)
_Source RedOval.image
_SetAlpha 0, Point(10, 10), RedOval.image
_Source GreenOval.image
_SetAlpha 0, Point(10, 10), GreenOval.image
_Source 0
MakeMask RedOval ' create mask for red oval image
MakeMask GreenOval ' create mask for green oval image