Show pointer full screen

Blitz3D Forums/Blitz3D Programming/Show pointer full screen

Rook Zimbabwe(Posted 2004) [#1]
I have a game I wrote that I set in 800X600,16,2....

I did this because I found that if I made it FULL SCREEN I lost the mouse pointer which is necessary for my game.

I used showpointer but nope...

Do I have to use a sprite as a pointer? How can I make that sprite as accurate as the mouse since whenever I use a sprite as a pointer it is always VERY off???

-RZ


Matty(Posted 2004) [#2]
There are ways to show a mouse pointer in Blitz3d which are accurate.
An easy way which may result in some slowdown is to use 2d commands:

MyCursor=loadimage("cursor.bmp")

and use DrawImage MyCursor,Mousex(),mousey(), and then use CameraPick with the mouse coordinates.

If you have the tip of the arrow in the centre of the image then run this line MidHandle MyCursor, if the tip of the arrow is in the
upper left corner then it should not be a problem.

If you wish to use a sprite in 3d then it is slightly more complicated to display it correctly.
There is code in the code archives for using a 3d mouse cursor with any zoom value which uses a second camera.
If you use a sprite then you should set the tip of the arrow on the mouse picture to the centre of the sprite.

Assuming you have a sprite with entity handle "Mouse3d" then do this:

EntityParent Mouse3d,Camera
MoveEntity Mouse3d,0,0,ScrWidth*0.5
EntityOrder mouse3d,"some negative number"
MoveMouse ScrWidth/2,ScrHeight/2


then in your main loop:
MoveEntity Mouse3d,MouseXSpeed(),-MouseYSpeed(),0



Rook Zimbabwe(Posted 2004) [#3]
My big prob mow is that 0,0 isn't the top LH Corner of the screen but SMACK in the gobstopping middle... I think I can fix that though...


jfk EO-11110(Posted 2004) [#4]
Check this command:
HandleImage image,x,y


Rook Zimbabwe(Posted 2004) [#5]
handleimage woks... I rmember that from an earlier discussion... mouse won't track though! I can't seem to get it to allow the mouse to go to negative numbers...


jhocking(Posted 2004) [#6]
Negative numbers? Why should you need negative numbers? Wait, is this a 2D or 3D game? The latter would explain why you need negative numbers, plus you should mix 2D and 3D commands anyway.


_PJ_(Posted 2004) [#7]
dO YOU NEED THE POINTER FOR 2d ICONS at XY screen coords or for manipulating 3D objects on camera?


IPete2(Posted 2004) [#8]
Don't dispair,

There is always a solution...

You could try the extended2d for B3d command set which is
lurking nearby.

IPete2.


Rook Zimbabwe(Posted 2004) [#9]
Game is 3D... wrote it that way for other reasons (learning how to do things for *other* game) LLook at the Gallery and check WaHoo! (thats me.)

Using camerapick to select square on grid and change color based on what tile comes up... GALLERY example has *da BOMB* piece showing... rare... other colors are the colors on the board.

But it is 3D... 3D doesn't seem to like this changing mouse cursor and in full screen I don't see the cursor. No matter what... OR I do see it but it doesn't correspond to the actual cursor location in any way!!! Its 3d... Perspective figures in and causes variance!


Rob Farley(Posted 2004) [#10]
If you want a mouse pointer...

Just do...

updateworld
renderworld
text mousex(),mousey(),"X",true,true
flip


Rook Zimbabwe(Posted 2004) [#11]
OK Rob... will try that... :)

WORKS!!! OK Rob is a Genius!


_PJ_(Posted 2004) [#12]
iT'S OKAY - mY LAPTOP DOESNT SHOW CURSOR IN FULLSCREEN 3D MODE EITHER. THe reason why i asked is because I wanted to know if 2d coords/imagehandling commands were good enough or you actually needed camerapics etc.

First off, HidePointer and use one of the above examples to simulate a mouse cursor with your own image (looks better too!)

mycursorimage=LoadImage("Cursor.bmp")




OR I do see it but it doesn't correspond to the actual cursor location in any way!!!


USE AN OVERLAYING IMAGE ON THE SCREEN IN 2D, as Rob describes 'after the rendering' Dont place this 'in' the 3D world or you'll get the coords confused and weird stuff will happen!!!

Second step, use

mx=MouseX()
my=MouseY()

In your loop and do your picks and checks with these coords.
before 'flip'

Drawimage mycursorimage,mx,my

:-)

-----------------------------------------------------

having said all that, IPete2 is right because using 2D overlaying 3D is apparently bad for performance. It would be more efficient to have a 3D cursor mesh/Sprite that would always be around the camera. However, Personally, I stick with the 2D overlay cos its simpler ;-)


Rook Zimbabwe(Posted 2004) [#13]
YOu see the secret is *BEFORE FLIP* I keep forgetting that... OK Malice is a Genius too!!!

-RZ


_PJ_(Posted 2004) [#14]

OK Malice is a Genius too!!!


LOL!!! Far from it!!! Good luck though ;-)