Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hello All! I have a bucket load of buttons on my user interface that would seem entirely alien when thrown in the face of a first time user, however if I were able to display text beside the cursor when hovered over a button this would make life much easier for the user. I know I could use a static 2D overlay to display and change when I hover an object, but is there a simple way to change the displayed mouse cursor when hovered over an icon? Any advice would be most appreciated. Thank you! |
||||
|
I found this code in an earlier forum: function onFrameDrawing() { var mouseX = ccbGetMousePosX(); var mouseY = ccbGetMousePosY(); ccbDrawTextureRectangleWithAlpha("customcursor.png", mouseX-10, mouseY-10, mouseX+10, mouseY+10); } ccbRegisterOnFrameEvent(onFrameDrawing); This does exactly what I need it to do once I hover over a button, I can change the cursor to display text when *on mouse hover* function.. However, I can't for the life of me figure out how to get it back to normal when *mouse hover exit* function. I tried to get it to load a blank .png on exit, but that didn't work, any advice? It appears I can only load one custom mouse texture and then it refuses to load any others. |
||||
|
All I need to know is what code I can add to this to get it to STOP DRAWING when I exit the 2D overlay on mouse hover. Then hopefully it will load another mouse cursor when I hover over the next 2D icon. What line of code can I add to stop drawing? |
||||
|
From the doc's : After you no longer need events, call ccbUnregisterOnFrameEvent() to unregister your function. |
||||
|
Yeaah.... Imma gunna need someone to add that line of code wherever it needs to go because I have absolutely no idea how script works lol I spent all my years as a modeler and animator. Scripting is an alien language to me. Can someone please post the new code so I can copy and paste it? Thanks! |
||||
|
Right so I've wasted hours on trying every variation of that code line and trying to get it to work, but I have no idea what I'm doing. I need, 'When Cursor Moved Over Do Something; OnEnter" Load a custom cursor. When Cursor 'On Exit'; I need the custom cursor to be unloaded. I also need custom cursors loaded for each button, for example: Button 1 will load Custom Cursor 1 on entry, and remove on Exit. Button 2 will load Custon Cursor 2 on enttry and remove on Exit. I will have a custom cursor .png made for each button. All I require is someone to post the code in full form here, so I can copy and paste. I will send $20 USD via paypal to whoever can help me get my tool tips performing as desired. Thanks. |
||||
|
wow $20!! first create a billboard and put it out of sight. in that billboard put 'every few seconds do something' with 1ms. in that execute this javascript. var winning = ccbGetCopperCubeVariable('button') that's code for 10 buttons. in each button, put 'on entermouse' ---> 'do later 10ms' ---> 'set variable the variable named "button" to the number of the button (1-10). (it's important you put the 'do later' action so make sure that extension is installed. and in each button put 'on leavemouse' ---> 'set variable' the variable named "button" to 0. that way when the cursor leaves the button it switches to a "clear texture. and that's it! |
||||
|
Hey Tim thank you very much for your reply. The soonest I am available I will test this immediately and see if I can get it to work. If I am able to get it to work the $20 USD is yours. In the meantime the offer is still on the table if anyone else has any other ways to do it, but I will be attempting them in the order they are posted. Thank you. |
||||
|
Also tim do you have skype? Maybe you can message me through this if I have difficulty. Thank you. |
||||
|
no, but i can be reached by phone via my website ---> http://www.timiscool.net |
||||
|
Tim, you lost me at "Enter Mouse" -> "Do Later". There appears to be no option to do anything later or After X amount of time in the "Enter Mouse" options for the "When Moused Over" options. |
||||
|
Tim do you have some form of Instant Messanger? Facebook? Wechat? Whatsapp? Anything? If you don't, are you able to organize a free skype account and add me? james_wards1 is my username. |
||||
|
Any chance you could whip this up in a coppercube file mock and send it through? Perhaps I could pull it apart that way, I can't for the life of me get this working. |
||||
|
ok let me see |
||||
|
Is there anyone who share custom mouse pointers because it'll help a lot. |
|