Bug with tint instruction
Posted: Sat Mar 09, 2024 7:30 pm
Bug with tint instruction, the instruction tinted the picture copied to brush 2, but also tinted the brush 1.
This bug is very strange of fact I though that the problem was in my code of my current project an adventure point and click R.P.G. game, but after to rewrote the routines and ideas several times, I try this code, and yes the problem or bug is in the Tint brush, that tinted the copy brush and the original.
Code: Select all
;Load a picture X.
@BRUSH 1, "pictureX.jpg", {Loader="inbuilt"}
;The variable Image takes the valour of 1 for the picture.
;because with this routine you can tint other pictures, in the same psotion X and Y.
Global Image=1
;Copy the picture 1 to picture 2.
CopyBrush(Image, 2)
;Now the picture 2 is tint to blue.
TintBrush(2, #BLUE, 64)
;Now copy the picture 2 (tinted) to Image.
CopyBrush(2, Image)
;Show the picture 2 tinted.
DisplayBrush(Image, 0, 0)
;But the picture 1 not tinted, is showed tinted like picture 2.
DisplayBrush(1, 200, 0)
EscapeQuit(False)
Repeat
WaitEvent