Hi,
I have three textures (they will be named as subtextures)
For example:
First texture - grass;
Second texture - details for grass;
Third textures - trees, shrubs.
I need to merge these textures to single (common texture) and apply to surface. But after merging I can change subtextures one time only.
If I want to do modification one more time the changes are not displayed on common texture. How can I fix issue?
Draw on texture:
private function Draw(x:uint, y:uint):void
{
var point:Point = new Point(x, y);
var textureMap:BitmapTexture = m_MapView.materialPlane;
m_Layers.groundLayer.copyPixels(m_Brush.brushData, m_Brush.rectBrush, point);
m_Layers.combineLayers(); //merge textures
textureMap.bitmapData = m_Layers.mainLayer;
}
m_Layers:
public function Layers(width:uint, height:uint)
{
m_MainLayer = new BitmapData(width, height, false, 0x000000);
m_bdGroundLayer = new BitmapData(width, height, false, 0x000000);
m_bdDetailsGroundLayer = new BitmapData(width, height, true, 0x000000);
m_bdStaticLayer = new BitmapData(width, height, true, 0x000000);
}
public function combineLayers():void
{
m_MainLayer.copyPixels(m_bdGroundLayer, m_bdGroundLayer.rect, new Point());
m_MainLayer.copyPixels(m_bdDetailsGroundLayer, m_bdDetailsGroundLayer.rect, new Point(),m_bdDetailsGroundLayer, new Point(), true);
m_MainLayer.copyPixels(m_bdStaticLayer, m_bdStaticLayer.rect, new Point(),m_bdStaticLayer, new Point(), true);
}
public function get mainLayer():BitmapData
{
combineLayers();
return m_MainLayer;
}
public function get groundLayer():BitmapData
{
return m_bdGroundLayer;
}
public function set groundLayer(value:BitmapData):void
{
m_bdGroundLayer = value;
}