Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Mouse Cursor in CopperCube

dynamogames
Registered User
Quote
2022-05-20 17:02:16

How do I make my mouse cursor to show in a game in the published version of a CopperCube Project
The published version is Windows


nigec
Registered User
Quote
2022-05-20 19:25:32

there's a script in the programing section that I used..
This is what I read but there's a few topics on the forum
http://coppercube.shoutwiki.com/wiki/Custom_mouse_cursor_in_CopperCube_6


function onFrameDrawing() {
var mX = ccbGetMousePosX();
var curs = "mycursor.png";
var mY = ccbGetMousePosY();
var tex = ccbLoadTexture(curs);
ccbDrawTextureRectangleWithAlpha(tex, mX - 4, mY - 4, mX + 28, mY + 28);

ccbSetCursorVisible(false);
}

ccbRegisterOnFrameEvent(onFrameDrawing);




just_in_case
Moderator
Quote
2022-05-21 06:31:37

There is also an extension on my website https://neophyte.cf that allows you to have a custom mouse cursor in your published game. If you are using the FPS camera then the cursor will be locked to the center.


nigec
Registered User
Quote
2022-05-21 11:14:36

nice, I'll give it a try :)


dynamogames
Registered User
Quote
2022-05-21 15:22:19

Thanks @just_in_case and @nigec


gree
Registered User
Quote
2022-11-11 01:04:48

@nigec, any clue why this won't work in webgl? Thanks.


just_in_case
Moderator
Quote
2022-11-11 10:08:09

@gree are you sure that it doesn't work in webGL, I have tested the extension and for me it does work in webGL as well, However the default mouse cursor isn't hidden in webGL. Do you want to hide it in webGL or you are facing some other issues?


gree
Registered User
Quote
2022-11-11 12:26:35

@just_in_case which browser did you tested it on?
I've tried brave and firefox on a debian 10 setup. CC runs via WINE; it could be anything :)

Testfile: This version works for Exe but not for WebGL (on my pc)
https://drive.google.com/drive/folders/1T9w8VBPDYd4EJ0yNR1p1VUlotIr7VDRm?usp=sharing

@just_in_case would you mind sharing your working scene with me so I can "counter check" it to find out what's going on, thank you.


Update: The cursor.png file gets also loaded by the code (Inspector). For some reason it just won't show up.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Intern?tional" (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© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact