12-16-2022, 04:39 PM
Something simple like this?
Code: (Select All)
Screen _NewImage(640, 480, 32)
$Color:32
Color White
_PrintString (100, 100), "Hello World"
For i = 0 To 10 Step 2
ChangeColor 100 + i * _FontWidth, 100, 1, White, Red
Next
Sub ChangeColor (WhereX, WhereY, HowManyCharacters, OriginalColor As _Unsigned Long, NewColor As _Unsigned Long)
Static m As _MEM
Dim o As _Offset
m = _MemImage(0)
x1 = WhereX
y1 = WhereY
x2 = x1 + HowManyCharacters * _FontWidth
y2 = y1 + HowManyCharacters * _FontHeight
$Checking:Off
For y = y1 * _Width * 4 To y2 * _Width * 4 Step _Width
For x = x1 * 4 To x2 * 4 Step 4
o = m.OFFSET + y + x
If _MemGet(m, o, _Unsigned Long) = OriginalColor Then _MemPut m, o, NewColor
Next
Next
$Checking:On
End Sub