Pryme8 Posted December 18, 2017 Share Posted December 18, 2017 It looks like with the never version release, texture objects variables have changed. What was the reasoning for this? Is there a quick fix I could do, like BABYLON.Texture._width = BABYLON.Texture.width? or something like that on my older files just to make a quick fix or do I need to track down all the script where I call the old variable names and update it? Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted December 18, 2017 Share Posted December 18, 2017 Hi @Pryme8 Not sure what's changed but you can probably do something like this; Object.defineProperty(BABYLON.Texture.prototype, 'oldName', { get: function() { return this.newName; }, set : function(value) { this.newName = value; }, enumerable: true, configurable: true }); that is what i do in my player controller anyways, so changes applied to player.position is applied to player._model.position Pryme8 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 18, 2017 Share Posted December 18, 2017 What changed? I do not think I changed anything on BABYLON.Texture object public properties Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted December 18, 2017 Author Share Posted December 18, 2017 "var example = new BABYLON.DynamicTexture('texture0', {width:1, height:1}, scene, false, 1);" example._texture._width is now example._texture.width same for height and for some other vars I would assume. I am working off the assumption that the _texture object in the dynamictexture is a BABYLON.Texture object but I may be mistaken. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted December 19, 2017 Author Share Posted December 19, 2017 Ok this is what changed: public createDynamicTexture(width: number, height: number, generateMipMaps: boolean, samplingMode: number): InternalTexture { var texture = new InternalTexture(this, InternalTexture.DATASOURCE_DYNAMIC) texture.baseWidth = width; texture.baseHeight = height; if (generateMipMaps) { width = this.needPOTTextures ? Tools.GetExponentOfTwo(width, this._caps.maxTextureSize) : width; height = this.needPOTTextures ? Tools.GetExponentOfTwo(height, this._caps.maxTextureSize) : height; } this.resetTextureCache(); texture.width = width; texture.height = height; texture.isReady = false; texture.generateMipMaps = generateMipMaps; texture.samplingMode = samplingMode; this.updateTextureSamplingMode(samplingMode, texture); this._internalTexturesCache.push(texture); return texture; } https://github.com/BabylonJS/Babylon.js/blob/master/src/Engine/babylon.engine.ts#L3352 Not a big deal, but figured Id point it out. I thought it was a texture object, but it looks like its just its own thing. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 19, 2017 Share Posted December 19, 2017 ok sounds good 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.