Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hey guys! I am very new to coppercube and javascript... Trying out the demo version and creating a simple click and play game, i want to change the mouse cursor for my game Any ideas on how to do this?? Please please! Tell me.... If you know how to change the cursor. And there is one more thing how to make an object follow another object ?? And how to set position near to an object on pressing a specific key? Any help regarding this will be appreciated.... |
||||
|
You can change the cursor in Windows .exe and Mac OS X app by making it invisible and drawing an image at its place. But you'd need scripting for this. Like this: function onFrameDrawing() You mean how to make an AI object follow another object? There is the scripting function "ccbAICommand". You could continuously tell an AI to move to the position of the object it should follow. |
||||
|
Instead of drawing a red rectangle isn't there any way to use a image as mouse cursor... |
||||
|
Got it, all i was need to is to read documentation carefully... Using a texture rectangle with alpha has just sort out my problem... @integer.parsenet you should also use a textured rectangle with alpha if u want to use custom cursor image. |
||||
|
Yes, use it like this: ccbDrawTextureRectangle("someFile.png", mouseX-100, mouseY-100, mouseX+100, mouseY+100); |
||||
|
If you want to use an image with alpha channel! ccbDrawTextureRectangleWithAlpha("someFile.png", mouseX-100, mouseY-100, mouseX+100, mouseY+100); |
||||
|
Dont forget to change the value of x-100,y-100,x+100,y+100 to a small one if you dont want your cursor to be oversized dude... |
||||
|
Excellent topic. You may change the cursor size as well by changing the mouseX-100 value to mouseX-200 to double the mouse cursor size for example in addition to the other parameters. |
|