Add highlighted target region for dissecting images.

This commit is contained in:
sigonasr2 2023-11-02 04:05:09 -05:00
parent f659e3267b
commit 67cf8515a8
7 changed files with 21 additions and 1 deletions

View File

@ -86,7 +86,10 @@ public:
} }
} }
} }
vf2d upperLeft={-1,-1};
vf2d lowerRight={-1,-1};
bool cabDetected=false;
bool dragging=false;
bool OnUserUpdate(float fElapsedTime) override bool OnUserUpdate(float fElapsedTime) override
{ {
// Called once per frame, draws random coloured pixels // Called once per frame, draws random coloured pixels
@ -98,6 +101,23 @@ public:
frameView-=fElapsedTime*60; frameView-=fElapsedTime*60;
UpdateScreen(); UpdateScreen();
} }
if(!cabDetected){
DrawString({4,ScreenHeight()-40},"Drag over the region where the cab's screen is located.\n (Make sure the entire cabinet screen is covered)",WHITE,2);
SetPixelMode(Pixel::ALPHA);
FillRectDecal(upperLeft,lowerRight-upperLeft,{255,255,255,128});
}
if(GetMouse(Mouse::LEFT).bPressed){
if(!dragging){
upperLeft=GetMousePos();
dragging=true;
}
}
if(GetMouse(Mouse::LEFT).bHeld){
lowerRight=GetMousePos();
}
if(GetMouse(Mouse::LEFT).bReleased){
dragging=false;
}
return true; return true;
} }
}; };

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB