Ambiera Forum

Discussions, Help and Support.

Create a new account, Search, or Login:
Name: Password:
Ambiera Forum > CopperCube > Help with CopperCube
Mouse Cursor in CopperCube
Author Text

dynamogames
Registered User
Quote
2022-09-07 16:31:12

Is it possible for the mouse cursor to show in a published CopperCube Scene with a 2D overlay. In my game, it is a game menu scene and the 2D overlay fills the whole screen with width and height of 100 * 100, I noticed that the mouse cursor does not show in the scene. Please is there a way to make it show and how?


dynamogames
Registered User
Quote
2022-09-07 16:41:22

I also want to ask what is the best approach to get optimal 2D images in Coppercube. In the past, I add a 2D image on a plane mesh and put a camera above it but I usually have to do a lot of scaling and stretching the plane mesh to get a perfect fit for the windows size but when the game is published this distorts the image resolution. I tried using 2D overlays now but I am having problems with mouse cursor like I mentioned above.


Guest
Guest
Quote
2022-09-07 16:42:45

To get the mouse cursor to show you need to have a simple camera as active in the scene and then when the player hits the play button or whatever set your FPS camera active. You might need to then run this code to hide the mouse cursor:

ccbSetCursorVisible("false");


dynamogames
Registered User
Quote
2022-09-07 16:50:49

Thanks but in my scene I use a FPS Camera. I don't know if what you said above would still work.
And where exactly do I run this code, is it on the 2D Overlay scene node or the camera scene node. Sorry I am not too familiar with Scripting in CopperCube
ccbSetCursorVisible("false");


Guest
Guest
Quote
2022-09-07 16:51:18

Regarding your second question, you can set your window to Exclusive/Fixed Size in your publishing settings to help with the distortion. I've seen Just_In_Case say that's better for the visuals.


Guest
Guest
Quote
2022-09-07 16:54:12

It will work because I've done it quite a few times already while making prototype levels for my game. For running the code, you can simply add an Execute Java Script action to your Before First Drawing Do Something behavior and paste the code in it. It should hide the cursor then.


Guest
Guest
Quote
2022-09-07 17:03:49

You can also run the code on the play button of your menu should your game menu and level be all in the same scene.


VP
Guest
Quote
2022-09-07 17:27:40

Depending on what you want to do with the 2D image, I tend to use a billboard (not vertical) as it always points perfectly towards the camera. I set the position of the billboard to 0,0,0 - I set the camera target to 0,0,0, I inspect the image size and set the width and height of the billboard to match. Image is then perfectly central and perfect scale and aspect ratio. You can move the camera or move the billboard to create a zoom/scaling effect. Depending on the image, you can turn Bilinear filtering on or off in irrlicht settings. I turn them off as it makes the image sharper and also avoids edge bleeding.


VP
Guest
Quote
2022-09-07 17:30:43

For the mouse problem, make sure you disable the "when occluded" option as this will disable mouse-clicking the overlay while incidentally moving over other nodes.


Aiming_bullets
Guest
Quote
2022-09-07 22:38:32

use the behavior that is available on https://neophyte.cf/ccb_behavior... simply use this behavior by just_in_case and it will do the job for you, you don't have to fiddle with any coding or any other hassle, select your 2D overlay and use it as crosshair and you are done.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internati?nal" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© 2020 Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact