Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Knobs and sliders

fg
Registered User
Quote
2017-07-06 16:21:39

I am trying to find out the easiest way to create knobs and sliders as a 2D overlay. The intention is to enable the users to make ingame settings of variables.

Is this possible with some of the current behaviours or plugins or would it require scripting?

Have anyone tried to do something similar with scripting?

Thank you!


pmax
Registered User
Quote
2017-07-06 21:04:00

Small example of sliderbar.
https://www.dropbox.com/s/x958a1...


fg
Registered User
Quote
2017-07-06 22:41:26

Thanks for posting Pmax, Did you create this yourself?

This slider system looks promising and I will study it to try to understand how it´s created. It works great in the Windows (exe) target but it seems to have a bug when publishing for the WebGL target where it hangs up not being able to leave the slider at a specific position...

Do you think it would be possible to rebuild this slider as a rotary knob?

Best!

Fredrik


fg
Registered User
Quote
2017-07-07 15:49:59

It seems like it is this line of code that doesn´t work with the WebGL target:

ccbUnregisterOnFrameEvent(onFrameDrawing);

Ambiera´s scripting reference doesn´t say that this only works with some of the targets. Anyone knows how to solve this problem?


pmax
Registered User
Quote
2017-07-07 18:37:48

I created this example to be compiled for Windows, I did not try to compile it for WebGL.


fg
Registered User
Quote
2017-07-07 20:05:33

I totally understand. Thank you for posting.
Your solution was just what I needed, spot on if it would have worked for webGL.
I don't have the knowledge to understand why it doesn't work.I hope someone can help with this.

Best

Fredrik


pmax
Registered User
Quote
2017-07-07 20:35:19

I tried to compile in WebGl and did not give me any problem, the only problem that sliderbar moves constantly.

The browser I used is the latest version of Firefox.

PS: Translation made by Google.


fg
Registered User
Quote
2017-07-07 20:48:13

Yes the slider is movable but when you're done dragging it you cant leave the cursor/handle in a desired position, it just continues to move with the mouse infinitely...
... which sadly renders this solution useless for Webgl. Strange isn't it?

With WebGL (Chrome). The Windows version works perfect.

Is there something that could be done?


pmax
Registered User
Quote
2017-07-07 21:20:52

update for WebGL.
It works now but still has defects.
https://www.dropbox.com/s/tarla9...


fg
Registered User
Quote
2017-07-07 22:32:57

You are absolutely amazing Pmax, thank you!


Now I can leave the cursor at a desired position an leave. But only once unfortunetaly. When the slider is set, it is set permanently...

I also tried to modify the behaviour to "when cursor moved over something" instead of "clicked upon" for a little smoother feeling but it still works only once..

(Tried it on Chrome)


3dblendsphinx
Registered User
Quote
2017-07-07 23:16:33

There is an issue when the 2D Overlay goes to Webgl I am going to work on a report for Niko. Anyhow I fixed what I was going to give you and it runs perfectly fine.

https://app.box.com/s/wpxf2s8emy...


3dblendsphinx
Registered User
Quote
2017-07-07 23:17:03

edit


fg
Registered User
Quote
2017-07-08 19:45:06

This one works like a charm. Thank you!


Create reply:


Posted by: (you are not logged in)


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