Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
Live transparancy adjustments for mesh textures

douwedabbe
Registered User
Quote
2019-06-10 10:52:33

I want to know if it is possible to modify transparancy of an png image attached to a 2D mesh through js scripting/actions etc.

2D_Overlay meshes do have the "Alpha" property but I can't use them, as my image and 2d Mesh are to large (approx 10x device.width). Feature needed for the android platform.

thanks


guest
Guest
Quote
2019-06-13 01:20:45

Scripting Window:
=================
// try some transparancy settings
var s = ccbGetSceneNodeFromName("MapBox_planeMesh");
var thing = ccbGetSceneNodeProperty(s, "Type");
print("The thing's Type is " + thing);

var t = ccbGetSceneNodeMaterialProperty(s, 0, "Texture1");
print("The plane texture is " + t);

var diff = ccbGetSceneNodeMaterialProperty(s, 0, "Diffuse");
print("The plane init difuseness is at " + diff);

var vect = new vector3d(255, 0, 0);
ccbSetSceneNodeMaterialProperty(s, 0, "Diffuse", vect);
var diff = ccbGetSceneNodeMaterialProperty(s, 0, "Diffuse");
print("The plane new difuseness is at " + diff);

ccbSetSceneNodeMaterialProperty(s, 0, "trans_add", 125);
ccbSetSceneNodeMaterialProperty(s, 0, "trans_alphach", 125);
// var trans = ccbGetSceneNodeMaterialProperty(s, 0, "trans_add");
print("The plane transparancy is at " + trans);



Message Log:
============
The thing's Type is mesh
The plane texture is c:\users\douwe dabbe\downloads\0-app-stuff\scr-screenshot\mapbox-layer-deventer.png
The plane init difuseness is at (0, 0.007843, 0.333333)
The plane new difuseness is at (0, 0.007843, 0.333333)
The plane transparancy is at false


Robo
Guest
Quote
2020-05-25 15:57:26

You CAN change the alpha - its called 'Param1' !!

Full transparency starts at 0.99 and goes down to 0.01 for full opaque. If you stick a plane in front of the players camera with the texture you want to change alpha for - you can do that now....


Create reply:


Posted by: (you are not logged in)


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