View Single Post
10-17-17, 05:51 AM   #1
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 358
Why does a mask object automatically flip an art horizontally?

Hi all,

Just for testing, I have made a parallelogram texture and applied this on a plain texture object as well as on a texture object with a mask object.

The first one draws an art as it is while the second one automatically flips an art horizontally...



Here's an exact code snippet:

Lua Code:
  1. local mask = UIParent:CreateMaskTexture();
  2. mask:SetTexture(parallel);
  3. mask:SetSize(256, 32);
  4. mask:SetPoint("RIGHT", UIParent, "CENTER", -50, 0);
  5.  
  6. local texture1 = UIParent:CreateTexture(nil, "ARTWORK");
  7. texture1:SetColorTexture(1, 1, 1);
  8. texture1:SetAllPoints(mask);
  9. texture1:AddMaskTexture(mask);
  10.  
  11. local texture2 = UIParent:CreateTexture(nil, "ARTWORK");
  12. texture2:SetTexture(parallel);
  13. texture2:SetSize(256, 32);
  14. texture2:SetPoint("LEFT", UIParent, "CENTER", 50, 0);

Is this an intended behavior of a mask object?

Thank you!
  Reply With Quote