Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
Something Wierd

Zoo
Guest
Quote
2017-12-09 23:52:43

Hi All, I am trying to cycle through this array and I am doing so succesfully...

When it gets to a certain point in the array I run this if statement


if ( TurnoverDensity > 0 && TurnoverDensity < 12000 )
{

print(TurnoverDensity );
print("red");
//Trading Density Bar
var sourceNode = ccbGetSceneNodeFromName("ShopToClone");
var newscenenode = ccbCloneSceneNode(sourceNode);
ccbSetSceneNodePositionWithoutCollision(newscenenode, Why, 0 , Ex);
ccbSetSceneNodeProperty(newscenenode, "Scale", 0.5, 10,0.5);
var tex = ccbLoadTexture("img/red10.png");
ccbSetSceneNodeMaterialProperty(newscenenode, 0, "Texture1", tex);

//Label
var sourceNode2 = ccbGetSceneNodeFromName("LabelToClone");
var newscenenode2 = ccbCloneSceneNode(sourceNode2);
ccbSetSceneNodePositionWithoutCollision(newscenenode2, Why + 10, 300 , Ex + 10);
var tex2 = ccbLoadTexture("Labels/" + shop + ".png");
ccbSetSceneNodeMaterialProperty(newscenenode2, 0, "Texture1", tex2);

//Line
var sourceNode = ccbGetSceneNodeFromName("Line");
var newscenenode = ccbCloneSceneNode(sourceNode);
ccbSetSceneNodePositionWithoutCollision(newscenenode, Why, 0 , Ex);
ccbSetSceneNodeProperty(newscenenode, "Scale", 0.05, 58.5,0.05);
var tex = ccbLoadTexture("img/red10.png");
ccbSetSceneNodeMaterialProperty(newscenenode, 0, "Texture1", tex);


}


There are 5 different if statements with different values for TurnoverDensity variable.

Everything works correctly except the colors come out wrong.

I am assigning the colors as textures red10 is the first colour... But even though the scene node is positioned correctly and the label is positioned correctly, the color is wrong...

Iam stumped, any help?


niko
Moderator
Quote
2017-12-10 09:31:22

Is it white or black instead, maybe? Maybe it wasn't able to load the texture?


Zoo
Guest
Quote
2017-12-10 13:59:11

Hi Niko

There are 7 color textures...None are white or black


niko
Moderator
Quote
2017-12-11 08:07:36

So what's wrong about the color then?


Create reply:


Posted by: (you are not logged in)


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