Jump to content

onBeforRender and Inherit


jiweigang1
 Share

Recommended Posts

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 ?
 

 

 

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...