View previous topic :: View next topic |
Author |
Message |
aeree Cheater Reputation: 3
Joined: 23 Jan 2010 Posts: 42 Location: Germany
|
Posted: Mon Nov 27, 2017 3:57 pm Post subject: Making TPanel unclickable |
|
|
I'm trying to make a cheap crosshair overlay in lazarus. I'm using TPanels
to form the individual lines of the crosshair. The problem I'm having is that
when I move my mouse around in an fps-game the cursor appears when it
moves over one of the panels. Clicking results in losing focus on the game
which sucks immensly.
Is there any way to make them unclickable or to instantly regain focus on the game
when clicking them.
Maybe trying a different method altogehter is better. I already tried using
GDI but I'm too stupid to get double buffering it to work. So any help on that
is also appreciated.
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25296 Location: The netherlands
|
Posted: Mon Nov 27, 2017 5:23 pm Post subject: |
|
|
Not sure there is a way. I think it's a windows thing where clicking on a window brings it to the foreground.
have you tried the d3d->set crosshair option?
or drawing a crosshair using the screen canvas ?
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
aeree Cheater Reputation: 3
Joined: 23 Jan 2010 Posts: 42 Location: Germany
|
Posted: Thu Nov 30, 2017 4:11 am Post subject: |
|
|
I'm worried about detection so i don't want to use d3d one. I tried using a
PaintBox on the form to draw on and it works Kind of. But the problem
remains. this time anything drawn on the canvas becomes clickable.
I settled with a bevel which outlines the location where the crosshair would
go. it leaves enough space so the mouse never hovers above it when
turning.
it far from what i want though. are there any other form elements that are
unclickable by default?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25296 Location: The netherlands
|
Posted: Thu Nov 30, 2017 4:30 am Post subject: |
|
|
You could use this code for an annoying flickering crosshair
Code: |
sc=getScreenCanvas()
sc.Pen.Color=0x00ff00 --green
width=getScreenWidth()
height=getScreenHeight()
centerx=width/2
centery=height/2
crosshairsize=4
t=createThread(function(t)
while t.Terminated==false do
sc.line(centerx-crosshairsize, centery, centerx+crosshairsize+1,centery) --horizontal
sc.line(centerx, centery-crosshairsize, centerx,centery+crosshairsize+1) --vertical
end
end)
|
Alternatively, just place a piece of transparent duct tape on the center of your screen and draw a small crosshair in it
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
aeree Cheater Reputation: 3
Joined: 23 Jan 2010 Posts: 42 Location: Germany
|
Posted: Thu Nov 30, 2017 9:47 am Post subject: |
|
|
The ductape one is the best so far. still worried about detection tho
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25296 Location: The netherlands
|
Posted: Thu Nov 30, 2017 6:19 pm Post subject: |
|
|
only on touchscreens lol
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
|