Mouse Pick

Blitz3D Forums/Blitz3D Beginners Area/Mouse Pick

AbbaRue(Posted 2009) [#1]
Been a while since I worked with my Blitz3D so I'm a little rusty.
This question is probably already answered somewhere here but.

How do I pick an object on the screen with my mouse.
What I want to do is write my own Keno game.
I must be able to select the numbers I want from the screen.
I plan on using an object for each of the 80 numbers.
Then I can animate each object as it is selected.

Thanks!


puki(Posted 2009) [#2]
Easiest way is probably a CameraPick based on the position of the mouse - CameraPick(camera,MouseX(),MouseY()).

EDIT:
Baring in mind you have to set EntityPickMode on the things you are picking.


AbbaRue(Posted 2009) [#3]
The example of CameraPick uses a 3D world and a cube.
And placing the cube in different locations causes perspective,
so the cube is distorted as it gets farther from the center of the screen.

I need it to be on a 2D screen, so each cube stays perfectly square.


puki(Posted 2009) [#4]
You can probably get around that with the CameraProjMode.


AbbaRue(Posted 2009) [#5]
Thanks that worked.
Needs the CameraZoom function as well.
I wish Blitz3D had simple gadget button commands.


Nate the Great(Posted 2009) [#6]
I wish Blitz3D had simple gadget button commands.


It doesnt because you can easily make your own. :) or download a dll