Well, this takes me back the best part of 20 years... I'm having trouble with an If statement!
I have a 3D world full of cubes and want to generate a tool-tip when the mouse pointer is hovering over any one of them.
here's the main loop:
While Not KeyHit(1)
; Handle Input code [removed to keep post short]
oldSelectedCube = selectedCube
selectedCube = CameraPick(camera,400,300)
If selectedCube Then
showToolTip = True
If selcetedCube <> oldSelectedCube Then SetToolTip(selectedCube)
Else
showToolTip = False
End If
; Update & Display [code removed to keep post short]
Wend
It's the line:
If selcetedCube <> oldSelectedCube Then SetToolTip(selectedCube)
that's giving me grief.
When I move the mouse pointer over a cube the tool tip is displayed correctly, but my SetToolTip() function gets called EVERY frame!
Strangly, if I change the "<>" opperator to "=" the SetToolTip() function isn't called every frame, but... it only gets called when the mouse pointer moves from empty space (no cube) to a cube and not when the pointer moves straight from one cube to another!
Anyone got any ideas?
I have a 3D world full of cubes and want to generate a tool-tip when the mouse pointer is hovering over any one of them.
here's the main loop:
While Not KeyHit(1)
; Handle Input code [removed to keep post short]
oldSelectedCube = selectedCube
selectedCube = CameraPick(camera,400,300)
If selectedCube Then
showToolTip = True
If selcetedCube <> oldSelectedCube Then SetToolTip(selectedCube)
Else
showToolTip = False
End If
; Update & Display [code removed to keep post short]
Wend
It's the line:
If selcetedCube <> oldSelectedCube Then SetToolTip(selectedCube)
that's giving me grief.
When I move the mouse pointer over a cube the tool tip is displayed correctly, but my SetToolTip() function gets called EVERY frame!
Strangly, if I change the "<>" opperator to "=" the SetToolTip() function isn't called every frame, but... it only gets called when the mouse pointer moves from empty space (no cube) to a cube and not when the pointer moves straight from one cube to another!
Anyone got any ideas?