Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
I have a cube mesh which is 10,10,10. I need to change the height dynamically with the Javascript API for a Business Intelligence solution . It is a default Cube primitive from coppercube editor I tried this code but it makes the object vanish var s = ccbGetSceneNodeFromName("TowerL40"); ccbSetSceneNodeProperty(s, "Scale", 20, 90,10); @Niko |
||||
|
Hello Zoo, I think your code is correct however you need to verify the object name Please note that you have to use the same name exactly as in the editor tree (case sensitive) Also, make sure that there is no value is 0 only (typo mistake)
|
||||
|
Worked thank you techno |
||||
|
always welcome |
||||
|
So I have managed to get the application working... Now I just need to know how the screenshots work on exe target, apparently you can create a screenshot folder? @techno-valley |
||||
|
hello, to save a screenshot from within the exe target, you'll have to use the javascript command ccbSaveScreenshot(filename) while using Execute JavaScript Action It saves the current content of the screen to a image file on the disk. Example (1) : Simple File Save Let's save a screenshot file named sshot.jpg so you will have to save as follow
This will save the screenshot in the same folder as the exe target. Example (2) : Save to folder C:\path\to\folder on your hard disk otherwise if you want to save to the target folder /path/to/folder so it will be as follow
Note that you have to change every slash " / " in the path with a double slash "//" Example (3) : Save to a folder in the same location as the EXE target and this folder is named Screenshots
Where .// indicates the current folder/directory |
||||
|
Perfect... Now I have a new problem... I have tried \r\n to create a carriage return in the 2D overlay....but it does not work. It did work before, but I can't remember how I got it working... I have a wall of data that I need to be fed line by line. @techno-valley |
||||
|
can you please specify what is the 2D overlay text source ? is it extracted from a variable ? |
||||
|
yes. I am pulling data from a database using http object and assigning it to a variable. I then set the text with change 2d overlay text action which is run ever 500 ms... The data comes out but all on one line |
||||
|
My code function finishedRequest(dataReceived) { //print("finished request! Data size:" + dataReceived); // var res= new Array(); var str1 = dataReceived; var res1 = str1.split("---"); var length = res1.length; //print(length); var i; var FinalString = []; var s = 0; for(i = 0 ; i < length - 1; i++) { //data format from php //Westgate---L10---0---NA<br>Westgate var j = i; var mall = res1[j]; var j = j + 1; var shop = res1[j]; var j = j + 1; var TurnoverDensity = res1[j]; var j = j + 1; var TurnOverDensityGroup = res1[j]; var i = j; var j = 0 ; FinalString[s] = mall + " - " + shop + " - " + TurnoverDensity + " - " + TurnOverDensityGroup; //split next string //var res2 = TurnOverDensityGroup.split("***"); //var TurnOverDensityGroupFinal = res2[0]; s++; //print(mall); //print(shop); //print(TurnoverDensity); //print(TurnOverDensityGroup); //print(TurnOverDensityGroupFinal); } m = s - 1; print(s); print(m); var counter = 0; var Together = "/r/n"; do{ Together = Together + "/r/n" + FinalString[counter]; counter++; }while(counter < m); ccbSetCopperCubeVariable("AllData", Together); //print(Together); } ccbDoHTTPRequest("pathtophpserverdata", finishedRequest); |
||||
|
Did you try to replace /r/n to \r\n ? lines: 49 and 52 |
||||
|
Hi there @techno-valley... Thanks for all your help. I managed to resolve this on my own. Instead of using the Coppercube behavior to update the text from a variable. I added this line of code to the bottom of my script and it worked perfectly var s = ccbGetSceneNodeFromName('Leaderboard'); ccbSetSceneNodeProperty(this.LastOverlayObject, 'Draw Text', true); ccbSetSceneNodeProperty(s, 'Text', OrderedScore); @Niko should consider updating the behaviour so that it works without having to write code. |
|