Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
You guys probably knew fog could be disabled (and enabled) dynamically at runtime. I tried this out of curiosity after I saw the "FogColor" parameter could be changed, so I decided to change the param name to "Fog". That works! Haha. var root = ccbGetRootSceneNode(); I'd guess FogDensity works too. I haven't tried it yet. Also: Obviously make sure to change it to true or false (depending on if you want to enable it or disable it) Enjoy. |
||||
|
As far as i know you can change every attributes property of any node dynamically, you can change attributes of Root node, a 2D overlay, particle system , water, meshnode etc. every attribute can be changed dynamically. |
||||
|
Cool. Why this isn't mentioned in the documentation is beyond me! |
||||
|
This works for all properties as displayed in the property window, with the exact name as displayed there. It's not documented because that only works in the Windows and MacOS targets. :) |
||||
|
wrote: Cool. Why this isn't mentioned in the documentation is beyond me! I agree - I had to work this all out myself also and found the same. I have a video with dynamic weather to see: https://www.youtube.com/watch?v=7J3YqpNgIOI |
||||
|
wrote: This works for all properties as displayed in the property window, with the exact name as displayed there. It's not documented because that only works in the Windows and MacOS targets. :) Hmm. Is there any reason why certain things work fine on the desktop targets whereas on WebGL / Android they're not usable? It's weird in a way. Isn't the JS-related stuff universal regardless of the desired platform? |
||||
|
Robo wrote: wrote: Cool. Why this isn't mentioned in the documentation is beyond me! I agree - I had to work this all out myself also and found the same. I have a video with dynamic weather to see: https://www.youtube.com/watch?v=7J3YqpNgIOI I saw that. Most impressed! I recently devised a very nice (but also time-consuming) technique which allows me to use dynamic lights on levels which have shadows + normalmaps (with a slight caveat) |
||||
|
wrote: Is there any reason why certain things work fine on the desktop targets whereas on WebGL / Android they're not usable? It's simply an implementation detail, and side effect. They are fundamentally different platforms, (like the WebGL platform is running itself in JavaScript, while this needs to be emulated in the Windows platform), so you have a lot of parts working differently internally, but trying to look like it's the same. The property thing was a nice feature, so I didn't prevent it because you can obviously do very cool things with that. |
||||
|
On similar note, I'm trying to change 'FollowSmoothingSpeed' of the 3rd person camera during gameplay, so far I tried: ccbSetSceneNodeProperty(ccbGetSceneNodeFromName("Camera1"), "FollowSmoothingSpeed", 5);...but that didn't work, I guess because it's a property of a behavior and not property of a camera? I also tried treating 'FollowSmoothingSpeed' as a variable but that, of course, didn't work since it was really a long shot :) Does anyone knows if this is possible, I mean it's possible because it is a property that can be tweaked in behavior, but can it be changed somehow during gameplay? |
|