With the recent release of the new threejs revision (r65), the uvOffset and uvScale have been relocated to texture.offset and texture.repeate.
However, I am facing an issue with the texture.offset not working as intended. My goal is to showcase multiple sprites in a scene, all using the same texture. This texture serves as a texture atlas with different tiles. Changing the texture offset impacts all sprites within the scene, which is not what I desire. Is there a way to adjust the offset individually for each sprite?
I believe uvOffset handled this task effectively, so I am puzzled as to why it was moved.
Below is some code illustrating my objective:
var gui_texture = THREE.ImageUtils.loadTexture('images/button.png');
var btn_material1 = new THREE.SpriteMaterial( { map:gui_texture } );
btn_material1.map.offset.set(0.5,0);
var button1 = new THREE.Sprite(btn_material1);
button1.position.set(-screen_half_x+50, screen_half_y-25, 1);
button1.scale.set(100, 50, 1);
gui_node.add(button1);
var btn_material2 = new THREE.SpriteMaterial( { map:gui_texture } );
btn_material2.map.offset.set(-0.5,0);
var button2 = new THREE.Sprite(btn_material2);
button2.position.set(-screen_half_x+50, screen_half_y-150, 1);
button2.scale.set(100, 50, 1.0);
gui_node.add(button2);
Best regards,
Markus