Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
help mouse

ca
Guest
Quote
2017-11-06 21:01:30

hello to all hope you can help me I used this script to load a texture for the mouse

function onFrameDrawing ()
{
  
  var mouseX = ccbGetMousePosX ();
  var mouseY = ccbGetMousePosY ();

    ccbDrawTextureRectangleWithAlpha ("customcursor.png", mouseX-10, mouseY-10, mouseX + 10, mouseY + 10);
}

ccbRegisterOnFrameEvent (onFrameDrawing);

the pquando I try the game appears on top of a console that says it has loaded the texture and can not make it visible? thank you so much


techno-valley
Registered User
Quote
2017-11-07 01:18:53

Hello,

It should be similar to the below code:


function onFrameDrawing () {
var mouseX = ccbGetMousePosX();
var mouseY = ccbGetMousePosY();
ccbDrawTextureRectangleWithAlpha ("customcursor.png", mouseX-10, mouseY-10, mouseX+10,mouseY+10);
}

ccbRegisterOnFrameEvent (onFrameDrawing);


Hints:
- Think about hiding the default mouse cursor as well (use ccbSetCursorVisible () function)
- Make sure that the customcursor.png exists in the same location as your project/executable otherwise use the full correct path holding the file (and make sure to replace every \ with \\ double slash in the path)

You may check the below quick example as well:
http://www.techno-valley.com/amb...


Zoo
Guest
Quote
2017-11-07 11:43:51

Added mouse template to MTM asset store under coppercube templates category on sidebar

https://marshtownmadness.com


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Interna?ional" (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