jiweigang1 Posted September 11, 2014 Share Posted September 11, 2014 i found the function onBeforRender for RenderTargetTexture if there is the function for Mesh so i can change mesh x y z to move it and i find its hard to use inherit like People extends Mesh i used ceatejs before and its easy to use inherit its a example(function() {var Button = function(label, color) { this.initialize(label, color);}var p = Button.prototype = new createjs.Container(); // inherit from Containerp.label;p.background;p.count = 0;p.Container_initialize = p.initialize;p.initialize = function(label, color) { this.Container_initialize(); this.label = label; if (!color) { color = "#CCC"; } var text = new createjs.Text(label, "20px Arial", "#000"); text.textBaseline = "top"; text.textAlign = "center"; var width = text.getMeasuredWidth()+30; var height = text.getMeasuredHeight()+20; this.background = new createjs.Shape(); this.background.graphics.beginFill(color).drawRoundRect(0,0,width,height,10); text.x = width/2; text.y = 10; this.addChild(this.background,text);}p.onClick = function() { alert("You clicked on a button: "+this.label);}p.onTick = function() { this.alpha = Math.cos(this.count++*0.1)*0.4+0.6;}window.Button = Button;}());how can i do that with BabylonJs ? Quote Link to comment Share on other sites More sharing options...
Temechon Posted September 11, 2014 Share Posted September 11, 2014 Hello, For inheritence, go see one of my tutorial : http://pixelcodr.com/tutos/plane/plane.htmlGo see the part : Ladies and gentlemen : the ship !Cheers, Quote Link to comment Share on other sites More sharing options...
jiweigang1 Posted September 15, 2014 Author Share Posted September 15, 2014 thank u @Temechon Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.