SRL Archive - FAQ

A little color picker problem


Archaic

2012-02-04 19:12:53

I've been working on a script or two for awhile and things are coming along well, but I've been having a single rather annoying problem.

Every time I try to use the color picker in simba, my screen turns entirely black with the crosshairs still on the screen. I can pick a color, but that color is always 0 or black because, well, the entire screen is black.

I think the problem could be from using Wine to run Simba on my mac (it definitely wouldn't be the first problem I've had with wine), but I'm not entirely sure what to do to fix it. Until I can fix this it is sort of hard for me to continue on as color is kinda important when it comes to Simba.

Any help would be greatly appreciated!

Thank you for your time,
Archaic

Screenshot of the problem in question…

Brandon

2012-02-04 19:31:25

Work around: Use the following to get the color..


{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}

Procedure DebugBMP(var X, Y: Integer);
var
BMP, Col, I: Integer;
TIA: TIntegerArray;
TPA: TPointArray;

begin
BMP:= CreateBitmap(51, 51);
TPA:= TPAFromBox(IntToBox(0, 0, 50, 50));
SetLength(TIA, Length(TPA));
GetMousePos(X, Y);
Col:= GetColor(X, Y);
For I:= 0 To Length(TIA) - 1 do
TIA[I] := Col;
FastSetPixels(BMP, TPA, TIA);
DebugBitmap(BMP);
FreeBitmap(BMP);
end;

Procedure DebugCol;
var
X, Y: Integer;
begin
repeat
if isMouseButtonDown(1) then
begin
GetMousePos(X, Y);
writeln(GetColor(X, Y));
wait(1000);
end;
DebugBMP(X, Y);
until(false);
end;

begin
SetupSRL;
DebugCol;
end.

Archaic

2012-02-04 20:34:59

Thank you so much that worked wonders :D